Mercurial > emacs
changeset 14729:b072589a6e57
(command-line-normalize-file-name): Do save-match-data.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 01 Mar 1996 20:13:01 +0000 |
parents | 3ce3907bd215 |
children | 5b81926cc17f |
files | lisp/startup.el |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/startup.el Fri Mar 01 20:11:49 1996 +0000 +++ b/lisp/startup.el Fri Mar 01 20:13:01 1996 +0000 @@ -911,13 +911,14 @@ (defun command-line-normalize-file-name (file) "Collapse multiple slashes to one, to handle non-Emacs file names." - ;; Use arg 1 so that we don't collapse // at the start of the file name. - ;; That is significant on some systems. - ;; However, /// at the beginning is supposed to mean just /, not //. - (if (string-match "^///+" file) - (setq file (replace-match "/" t t file))) - (while (string-match "//+" file 1) - (setq file (replace-match "/" t t file))) - file) + (save-match-data + ;; Use arg 1 so that we don't collapse // at the start of the file name. + ;; That is significant on some systems. + ;; However, /// at the beginning is supposed to mean just /, not //. + (if (string-match "^///+" file) + (setq file (replace-match "/" t t file))) + (while (string-match "//+" file 1) + (setq file (replace-match "/" t t file))) + file)) ;;; startup.el ends here