From d27b137289567c9b91f93dff8cdbb5748529cdfa Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 25 Sep 2020 02:27:01 +0200 Subject: [PATCH] Clean up replace-in-string slightly * lisp/subr.el (replace-in-string): Clean up previous fix slightly. --- lisp/subr.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.5