Commit 98e775e6 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix command-line-normalize-file-name for DOS/Windows file names.

 lisp/startup.el (command-line-normalize-file-name): Fix handling of
 backslashes in DOS and Windows file names.  Reported by Xue Fuqiao
 <xfq.free@gmail.com> in
 http://lists.gnu.org/archive/html/help-gnu-emacs/2013-03/msg00245.html.
parent cded56c1
2013-03-16 Eli Zaretskii <eliz@gnu.org>
* startup.el (command-line-normalize-file-name): Fix handling of
backslashes in DOS and Windows file names. Reported by Xue Fuqiao
<xfq.free@gmail.com> in
http://lists.gnu.org/archive/html/help-gnu-emacs/2013-03/msg00245.html.
2013-03-15 Michael Albinus <michael.albinus@gmx.de>
 
Sync with Tramp 2.2.7.
......
......@@ -2399,13 +2399,17 @@ A fancy display is used on graphic displays, normal otherwise."
;; 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)
(if (string-match
(if (memq system-type '(ms-dos windows-nt))
"^\\([\\/][\\/][\\/]\\)+"
"^///+")
file)
(setq file (replace-match "/" t t file)))
(and (memq system-type '(ms-dos windows-nt))
(string-match "^[A-Za-z]:\\(\\\\[\\\\/]\\)" file) ; C:\/ or C:\\
(setq file (replace-match "/" t t file 1)))
(while (string-match "//+" file 1)
(setq file (replace-match "/" t t file)))
(if (memq system-type '(ms-dos windows-nt))
(while (string-match "\\([\\/][\\/]\\)+" file 1)
(setq file (replace-match "/" t t file)))
(while (string-match "//+" file 1)
(setq file (replace-match "/" t t file))))
file))
;;; startup.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment