# HG changeset patch # User Michael Albinus # Date 1255612516 0 # Node ID 33df72cf19f110a30f1a9c7bf1dfb9d03130781e # Parent 1823e414dc499f327d65f542f7267ac653c23e20 * net/tramp.el (tramp-replace-environment-variables): Do not fail if the environment variable does not exist. diff -r 1823e414dc49 -r 33df72cf19f1 lisp/net/tramp.el --- a/lisp/net/tramp.el Thu Oct 15 10:18:17 2009 +0000 +++ b/lisp/net/tramp.el Thu Oct 15 13:15:16 2009 +0000 @@ -3922,9 +3922,11 @@ "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))