From: Lars Ingebrigtsen Date: Fri, 25 Sep 2020 00:27:01 +0000 (+0200) Subject: Clean up replace-in-string slightly X-Git-Tag: emacs-28.0.90~5899 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d27b137289567c9b91f93dff8cdbb5748529cdfa;p=emacs.git Clean up replace-in-string slightly * lisp/subr.el (replace-in-string): Clean up previous fix slightly. --- diff --git a/lisp/subr.el b/lisp/subr.el index 0de9ac5d960..33ed0bc9367 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4440,8 +4440,9 @@ Unless optional argument INPLACE is non-nil, return a new string." (push (substring instring start pos) result)) (push tostring result) (setq start (+ pos (length fromstring)))) + ;; Get any remaining bit. (unless (= start (length instring)) - (push (substring instring start pos) result)) + (push (substring instring start) result)) (apply #'concat (nreverse result)))) (defun replace-regexp-in-string (regexp rep string &optional