diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-03-01 20:13:01 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-03-01 20:13:01 +0000 |
commit | a3936d6ac87950245634f56e0e674e37f3e30e3b (patch) | |
tree | bfae3d6763cfa2c38a5745393aac95d3f0087a05 /lisp/startup.el | |
parent | 89ad3af9f57db993c844055798d8704851bb7436 (diff) | |
download | emacs-a3936d6ac87950245634f56e0e674e37f3e30e3b.tar.gz |
(command-line-normalize-file-name): Do save-match-data.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r-- | lisp/startup.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 16214b17656..db74a389f66 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -911,13 +911,14 @@ Type \\[describe-distribution] for information on getting the latest version.")) (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 |