Fix Bug#32304
* lisp/net/tramp.el (tramp-handle-substitute-in-file-name): Handle special cas on Cygwin and MS-Windows. (Bug#32304)
This commit is contained in:
parent
63ef793299
commit
82d6416a28
1 changed files with 8 additions and 4 deletions
|
@ -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 "/")
|
||||
|
|
Loading…
Add table
Reference in a new issue