changeset 25415:862886e87cf5

(dired-string-replace-match): Return `nil' when no match found with global search.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Aug 1999 18:23:14 +0000
parents 7c4808c6804b
children 851241b72ec9
files lisp/dired.el
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Sat Aug 28 18:22:20 1999 +0000
+++ b/lisp/dired.el	Sat Aug 28 18:23:14 1999 +0000
@@ -1315,12 +1315,12 @@
 Optional arg LITERAL means to take NEWTEXT literally.
 Optional arg GLOBAL means to replace all matches."
   (if global
-      (let ((start 0))
+      (let ((start 0) ret)
 	(while (string-match regexp string start)
 	  (let ((from-end (- (length string) (match-end 0))))
-	    (setq string (replace-match newtext t literal string))
+	    (setq ret (setq string (replace-match newtext t literal string)))
 	    (setq start (- (length string) from-end))))
-	  string)
+	  ret)
     (if (not (string-match regexp string 0))
 	nil
       (replace-match newtext t literal string))))