From 6b9e794f8cc0af8cd8e2eaf041e19d5d41e927e1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 1 Mar 1996 20:13:01 +0000 Subject: [PATCH] (command-line-normalize-file-name): Do save-match-data. --- lisp/startup.el | 17 +++++++++-------- 1 file 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 -- 2.39.5