summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorEduard Wiebe <usenet@pusto.de>2010-11-27 11:56:49 +0200
committerEli Zaretskii <eliz@gnu.org>2010-11-27 11:56:49 +0200
commitd1882ac7c91cbaa51aeea68433f1867e73a431c2 (patch)
tree16483fbbb771b967bca9ebfaa30bf5bde90e4afc /lisp/dired.el
parentda2b5401e8747adb28558684b48328806bf43e1e (diff)
downloademacs-d1882ac7c91cbaa51aeea68433f1867e73a431c2.tar.gz
Fix bug #7308 with `locate' on MS-Windows.
dired.el (dired-get-filename): Replace backslashes with slashes in file names on MS-Windows, needed by `locate'. locate.el (locate-default-make-command-line): Don't consider drive letter and root directory part of `directory-listing-before-filename-regexp'. (locate-post-command-hook, locate-post-command-hook): New defcustoms.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index bb0cc223281..b2bd082b1a6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2012,6 +2012,14 @@ Otherwise, an error occurs in these cases."
;; with quotation marks in their names.
(while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
(setq file (replace-match "\\\"" nil t file 1)))
+
+ (when (eq system-type 'windows-nt)
+ (save-match-data
+ (let ((start 0))
+ (while (string-match "\\\\" file start)
+ (aset file (match-beginning 0) ?/)
+ (setq start (match-end 0))))))
+
(setq file (read (concat "\"" file "\"")))
;; The above `read' will return a unibyte string if FILE
;; contains eight-bit-control/graphic characters.