aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2009-10-15 13:15:16 +0000
committerMichael Albinus2009-10-15 13:15:16 +0000
commitec5145d68462c93fd4b4ab3c6aa6b01b7c3d3902 (patch)
treef0bff3e4b665cf0a164f10118905cb3bf6e45b2e
parentb53f6df2950a72a0a697a8d017121f70e2959e4e (diff)
downloademacs-ec5145d68462c93fd4b4ab3c6aa6b01b7c3d3902.tar.gz
emacs-ec5145d68462c93fd4b4ab3c6aa6b01b7c3d3902.zip
* net/tramp.el (tramp-replace-environment-variables): Do not fail
if the environment variable does not exist.
-rw-r--r--lisp/net/tramp.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e227de57df4..e7ca0143cc6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3922,9 +3922,11 @@ the result will be a local, non-Tramp, filename."
3922 "Replace environment variables in FILENAME. 3922 "Replace environment variables in FILENAME.
3923Return the string with the replaced variables." 3923Return the string with the replaced variables."
3924 (save-match-data 3924 (save-match-data
3925 (let ((idx (string-match "$\\w+" filename))) 3925 (let ((idx (string-match "$\\(\\w+\\)" filename)))
3926 ;; `$' is coded as `$$'. 3926 ;; `$' is coded as `$$'.
3927 (when (and idx (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))) 3927 (when (and idx
3928 (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
3929 (getenv (match-string 1 filename)))
3928 (setq filename 3930 (setq filename
3929 (replace-match 3931 (replace-match
3930 (substitute-in-file-name (match-string 0 filename)) 3932 (substitute-in-file-name (match-string 0 filename))