From: Michael Albinus Date: Thu, 15 Oct 2009 13:15:16 +0000 (+0000) Subject: * net/tramp.el (tramp-replace-environment-variables): Do not fail X-Git-Tag: emacs-pretest-23.1.90~790 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec5145d68462c93fd4b4ab3c6aa6b01b7c3d3902;p=emacs.git * net/tramp.el (tramp-replace-environment-variables): Do not fail if the environment variable does not exist. --- 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." "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))