mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-21 18:23:59 +00:00
* net/tramp.el (tramp-replace-environment-variables): Do not fail
if the environment variable does not exist.
This commit is contained in:
parent
b53f6df295
commit
ec5145d684
@ -3922,9 +3922,11 @@ the result will be a local, non-Tramp, filename."
|
||||
"Replace environment variables in FILENAME.
|
||||
Return the string with the replaced variables."
|
||||
(save-match-data
|
||||
(let ((idx (string-match "$\\w+" filename)))
|
||||
(let ((idx (string-match "$\\(\\w+\\)" filename)))
|
||||
;; `$' is coded as `$$'.
|
||||
(when (and idx (or (zerop idx) (not (eq ?$ (aref filename (1- idx))))))
|
||||
(when (and idx
|
||||
(or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
|
||||
(getenv (match-string 1 filename)))
|
||||
(setq filename
|
||||
(replace-match
|
||||
(substitute-in-file-name (match-string 0 filename))
|
||||
|
Loading…
Reference in New Issue
Block a user