# HG changeset patch # User james # Date 1087441708 0 # Node ID 9d6ec778e1e8004471aaeed7af4f76371552ef93 # Parent e6d43c299b9c8017bac67d89421e7755b7b8fc03 [xemacs-hg @ 2004-06-17 03:08:28 by james] Fix setf of a substring when start is negative. diff -r e6d43c299b9c -r 9d6ec778e1e8 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jun 17 03:01:17 2004 +0000 +++ b/lisp/ChangeLog Thu Jun 17 03:08:28 2004 +0000 @@ -1,3 +1,8 @@ +2004-06-16 Jerry James + + * cl.el (cl-set-substring): Increment start by the length of the + string, not the string itself. + 2004-06-07 Jerry James * derived.el: Synch with Emacs 21.3. diff -r e6d43c299b9c -r 9d6ec778e1e8 lisp/cl.el --- a/lisp/cl.el Thu Jun 17 03:01:17 2004 +0000 +++ b/lisp/cl.el Thu Jun 17 03:08:28 2004 +0000 @@ -215,7 +215,7 @@ (defun cl-set-substring (str start end val) (if end (if (< end 0) (incf end (length str))) (setq end (length str))) - (if (< start 0) (incf start str)) + (if (< start 0) (incf start (length str))) (concat (and (> start 0) (substring str 0 start)) val (and (< end (length str)) (substring str end))))