1
0
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:
Michael Albinus 2009-10-15 13:15:16 +00:00
parent b53f6df295
commit ec5145d684

View File

@ -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))