From: Michael Albinus Date: Tue, 31 Jul 2018 04:50:30 +0000 (+0200) Subject: Fix Bug#32304 X-Git-Tag: emacs-27.0.90~4664^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=82d6416a28dc5b4ab65b8081f035679bec4e3604;p=emacs.git Fix Bug#32304 * lisp/net/tramp.el (tramp-handle-substitute-in-file-name): Handle special cas on Cygwin and MS-Windows. (Bug#32304) --- 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." ;; First, we must replace environment variables. (setq filename (tramp-replace-environment-variables filename)) (with-parsed-tramp-file-name filename nil - ;; We do not want to replace environment variables, again. + ;; We do not want to replace environment variables, again. "//" + ;; has a special meaning at the beginning of a file name on + ;; Cygwin and MS-Windows, we must remove it. (let (process-environment) ;; Ignore in LOCALNAME everything before "//" or "/~". (when (stringp localname) (if (string-match "//\\(/\\|~\\)" localname) - (setq filename (substitute-in-file-name localname)) + (setq filename + (replace-regexp-in-string + "\\`/+" "/" (substitute-in-file-name localname))) (setq filename (concat (file-remote-p filename) - (tramp-run-real-handler - 'substitute-in-file-name (list localname))))))) + (replace-regexp-in-string + "\\`/+" "/" (substitute-in-file-name localname))))))) ;; "/m:h:~" does not work for completion. We use "/m:h:~/". (if (and (stringp localname) (string-equal "~" localname)) (concat filename "/")