diff options
| author | Jason Rumney | 2002-11-27 23:53:44 +0000 |
|---|---|---|
| committer | Jason Rumney | 2002-11-27 23:53:44 +0000 |
| commit | 06dd5ef70bf50693684b9bdf62bd7f1a281f74e1 (patch) | |
| tree | e4eaf4c5cbfcadded7821379ff6def0256533e22 | |
| parent | 4bc12672406fab145035c2c24fc0cac8caf5844b (diff) | |
| download | emacs-06dd5ef70bf50693684b9bdf62bd7f1a281f74e1.tar.gz emacs-06dd5ef70bf50693684b9bdf62bd7f1a281f74e1.zip | |
(file-truename): Canonicalize non-existent names on w32.
| -rw-r--r-- | lisp/files.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/files.el b/lisp/files.el index 1a7d54b61a7..5de6559ae51 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -675,18 +675,17 @@ Do not specify them in other calls." | |||
| 675 | ;; it is stored on disk (expanding short name aliases with the full | 675 | ;; it is stored on disk (expanding short name aliases with the full |
| 676 | ;; name in the process). | 676 | ;; name in the process). |
| 677 | (if (eq system-type 'windows-nt) | 677 | (if (eq system-type 'windows-nt) |
| 678 | (let ((handler (find-file-name-handler filename 'file-truename)) | 678 | (let ((handler (find-file-name-handler filename 'file-truename))) |
| 679 | newname) | ||
| 680 | ;; For file name that has a special handler, call handler. | 679 | ;; For file name that has a special handler, call handler. |
| 681 | ;; This is so that ange-ftp can save time by doing a no-op. | 680 | ;; This is so that ange-ftp can save time by doing a no-op. |
| 682 | (if handler | 681 | (if handler |
| 683 | (setq filename (funcall handler 'file-truename filename)) | 682 | (setq filename (funcall handler 'file-truename filename)) |
| 684 | ;; If filename contains a wildcard, newname will be the old name. | 683 | ;; If filename contains a wildcard, newname will be the old name. |
| 685 | (if (string-match "[[*?]" filename) | 684 | (unless (string-match "[[*?]" filename) |
| 686 | (setq newname filename) | 685 | ;; If filename exists, use the long name, otherwise |
| 687 | ;; If filename doesn't exist, newname will be nil. | 686 | ;; canonicalize the name, to handle case differences. |
| 688 | (setq newname (w32-long-file-name filename))) | 687 | (setq filename (or (w32-long-file-name filename) |
| 689 | (setq filename (or newname filename))) | 688 | (untranslated-canonical-name filename))))) |
| 690 | (setq done t))) | 689 | (setq done t))) |
| 691 | 690 | ||
| 692 | ;; If this file directly leads to a link, process that iteratively | 691 | ;; If this file directly leads to a link, process that iteratively |