summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-08-28 18:23:14 +0000
committerRichard M. Stallman <rms@gnu.org>1999-08-28 18:23:14 +0000
commitb976e099be16b765534aa96758d4c829c6dc8968 (patch)
tree1a3885acfae57d8815b57011f53daff061a3bc14 /lisp/dired.el
parentee13a145ea15e9bd352a3fd920281195e2686789 (diff)
downloademacs-b976e099be16b765534aa96758d4c829c6dc8968.tar.gz
(dired-string-replace-match): Return `nil' when no match
found with global search.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index c493c1598ba..c514fa2e31f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1315,12 +1315,12 @@ If it does not match, nil is returned instead of the new string.
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))))