aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-03-16 10:20:36 +0200
committerEli Zaretskii2013-03-16 10:20:36 +0200
commit98e775e640b18104c1c83cf29d00f34605bde35d (patch)
tree5ce88550a3ffddfd1dce1716b91829a58b81791d
parentcded56c19b30e038537398b5213438c339428ed9 (diff)
downloademacs-98e775e640b18104c1c83cf29d00f34605bde35d.tar.gz
emacs-98e775e640b18104c1c83cf29d00f34605bde35d.zip
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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/startup.el16
2 files changed, 17 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 41e78c7885a..2c729e3d5b7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-03-16 Eli Zaretskii <eliz@gnu.org>
2
3 * startup.el (command-line-normalize-file-name): Fix handling of
4 backslashes in DOS and Windows file names. Reported by Xue Fuqiao
5 <xfq.free@gmail.com> in
6 http://lists.gnu.org/archive/html/help-gnu-emacs/2013-03/msg00245.html.
7
12013-03-15 Michael Albinus <michael.albinus@gmx.de> 82013-03-15 Michael Albinus <michael.albinus@gmx.de>
2 9
3 Sync with Tramp 2.2.7. 10 Sync with Tramp 2.2.7.
diff --git a/lisp/startup.el b/lisp/startup.el
index ad31a7a2a45..db84a5b11b2 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2399,13 +2399,17 @@ A fancy display is used on graphic displays, normal otherwise."
2399 ;; Use arg 1 so that we don't collapse // at the start of the file name. 2399 ;; Use arg 1 so that we don't collapse // at the start of the file name.
2400 ;; That is significant on some systems. 2400 ;; That is significant on some systems.
2401 ;; However, /// at the beginning is supposed to mean just /, not //. 2401 ;; However, /// at the beginning is supposed to mean just /, not //.
2402 (if (string-match "^///+" file) 2402 (if (string-match
2403 (if (memq system-type '(ms-dos windows-nt))
2404 "^\\([\\/][\\/][\\/]\\)+"
2405 "^///+")
2406 file)
2403 (setq file (replace-match "/" t t file))) 2407 (setq file (replace-match "/" t t file)))
2404 (and (memq system-type '(ms-dos windows-nt)) 2408 (if (memq system-type '(ms-dos windows-nt))
2405 (string-match "^[A-Za-z]:\\(\\\\[\\\\/]\\)" file) ; C:\/ or C:\\ 2409 (while (string-match "\\([\\/][\\/]\\)+" file 1)
2406 (setq file (replace-match "/" t t file 1))) 2410 (setq file (replace-match "/" t t file)))
2407 (while (string-match "//+" file 1) 2411 (while (string-match "//+" file 1)
2408 (setq file (replace-match "/" t t file))) 2412 (setq file (replace-match "/" t t file))))
2409 file)) 2413 file))
2410 2414
2411;;; startup.el ends here 2415;;; startup.el ends here