Commit 06dd5ef7 authored by Jason Rumney's avatar Jason Rumney
Browse files

(file-truename): Canonicalize non-existent names on w32.

parent 4bc12672
...@@ -675,18 +675,17 @@ Do not specify them in other calls." ...@@ -675,18 +675,17 @@ Do not specify them in other calls."
;; it is stored on disk (expanding short name aliases with the full ;; it is stored on disk (expanding short name aliases with the full
;; name in the process). ;; name in the process).
(if (eq system-type 'windows-nt) (if (eq system-type 'windows-nt)
(let ((handler (find-file-name-handler filename 'file-truename)) (let ((handler (find-file-name-handler filename 'file-truename)))
newname)
;; For file name that has a special handler, call handler. ;; For file name that has a special handler, call handler.
;; This is so that ange-ftp can save time by doing a no-op. ;; This is so that ange-ftp can save time by doing a no-op.
(if handler (if handler
(setq filename (funcall handler 'file-truename filename)) (setq filename (funcall handler 'file-truename filename))
;; If filename contains a wildcard, newname will be the old name. ;; If filename contains a wildcard, newname will be the old name.
(if (string-match "[[*?]" filename) (unless (string-match "[[*?]" filename)
(setq newname filename) ;; If filename exists, use the long name, otherwise
;; If filename doesn't exist, newname will be nil. ;; canonicalize the name, to handle case differences.
(setq newname (w32-long-file-name filename))) (setq filename (or (w32-long-file-name filename)
(setq filename (or newname filename))) (untranslated-canonical-name filename)))))
(setq done t))) (setq done t)))
;; If this file directly leads to a link, process that iteratively ;; If this file directly leads to a link, process that iteratively
......
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