diff options
| author | Michael Albinus | 2018-07-31 06:50:30 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-07-31 06:50:30 +0200 |
| commit | 82d6416a28dc5b4ab65b8081f035679bec4e3604 (patch) | |
| tree | 82452a2104b5e153afdd0f876844ddba64bba71e | |
| parent | 63ef79329935b790b9c8107125bce66e1f272c2e (diff) | |
| download | emacs-82d6416a28dc5b4ab65b8081f035679bec4e3604.tar.gz emacs-82d6416a28dc5b4ab65b8081f035679bec4e3604.zip | |
Fix Bug#32304
* lisp/net/tramp.el (tramp-handle-substitute-in-file-name):
Handle special cas on Cygwin and MS-Windows. (Bug#32304)
| -rw-r--r-- | lisp/net/tramp.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d56b09a604d..1af2defd586 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3567,16 +3567,20 @@ support symbolic links." | |||
| 3567 | ;; First, we must replace environment variables. | 3567 | ;; First, we must replace environment variables. |
| 3568 | (setq filename (tramp-replace-environment-variables filename)) | 3568 | (setq filename (tramp-replace-environment-variables filename)) |
| 3569 | (with-parsed-tramp-file-name filename nil | 3569 | (with-parsed-tramp-file-name filename nil |
| 3570 | ;; We do not want to replace environment variables, again. | 3570 | ;; We do not want to replace environment variables, again. "//" |
| 3571 | ;; has a special meaning at the beginning of a file name on | ||
| 3572 | ;; Cygwin and MS-Windows, we must remove it. | ||
| 3571 | (let (process-environment) | 3573 | (let (process-environment) |
| 3572 | ;; Ignore in LOCALNAME everything before "//" or "/~". | 3574 | ;; Ignore in LOCALNAME everything before "//" or "/~". |
| 3573 | (when (stringp localname) | 3575 | (when (stringp localname) |
| 3574 | (if (string-match "//\\(/\\|~\\)" localname) | 3576 | (if (string-match "//\\(/\\|~\\)" localname) |
| 3575 | (setq filename (substitute-in-file-name localname)) | 3577 | (setq filename |
| 3578 | (replace-regexp-in-string | ||
| 3579 | "\\`/+" "/" (substitute-in-file-name localname))) | ||
| 3576 | (setq filename | 3580 | (setq filename |
| 3577 | (concat (file-remote-p filename) | 3581 | (concat (file-remote-p filename) |
| 3578 | (tramp-run-real-handler | 3582 | (replace-regexp-in-string |
| 3579 | 'substitute-in-file-name (list localname))))))) | 3583 | "\\`/+" "/" (substitute-in-file-name localname))))))) |
| 3580 | ;; "/m:h:~" does not work for completion. We use "/m:h:~/". | 3584 | ;; "/m:h:~" does not work for completion. We use "/m:h:~/". |
| 3581 | (if (and (stringp localname) (string-equal "~" localname)) | 3585 | (if (and (stringp localname) (string-equal "~" localname)) |
| 3582 | (concat filename "/") | 3586 | (concat filename "/") |