diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-25 02:07:05 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-25 02:07:05 +0200 |
commit | 09adf92644112dbd09865b9de703868ea50c2d4f (patch) | |
tree | d0f8984b75e94756daae66e280d7618f317750f4 /lisp | |
parent | 7f9ad5980ce2e998ef57a95c2283d1a87d5613d1 (diff) | |
download | emacs-09adf92644112dbd09865b9de703868ea50c2d4f.tar.gz emacs-09adf92644112dbd09865b9de703868ea50c2d4f.tar.bz2 emacs-09adf92644112dbd09865b9de703868ea50c2d4f.zip |
Fix previous replace-in-string rewrite
* lisp/subr.el (replace-in-string): Fix logic errors in previous
patch.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/subr.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 0f72b382fe8..0de9ac5d960 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4439,8 +4439,8 @@ Unless optional argument INPLACE is non-nil, return a new string." (unless (= start pos) (push (substring instring start pos) result)) (push tostring result) - (setq start (+ start (length fromstring)))) - (unless (= start pos) + (setq start (+ pos (length fromstring)))) + (unless (= start (length instring)) (push (substring instring start pos) result)) (apply #'concat (nreverse result)))) |