1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

(command-line-normalize-file-name): Do save-match-data.

This commit is contained in:
Richard M. Stallman 1996-03-01 20:13:01 +00:00
parent 6a21225cd1
commit 6b9e794f8c

View File

@ -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