diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ffcf8f4929c..fc897fb2a7c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -7406,7 +7406,8 @@ T1 and T2 are time values (as returned by `current-time' for example)." Suppress `shell-file-name'. This is needed on w32 systems, which would use a wrong quoting for local file names. See `w32-shell-name'." (let (shell-file-name) - (shell-quote-argument (file-name-unquote s)))) + ;; Do not expand remote file names w/o a localname. + (shell-quote-argument (file-name-unquote s 'top)))) ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' ;; does not deal well with newline characters. Newline is replaced by diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index d6eb782df3d..c0ad7205c5d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6524,8 +6524,7 @@ INPUT, if non-nil, is a string sent to the process." "Check that remote processes set / unset environment variables properly." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) - (skip-unless (tramp--test-sh-p)) - (skip-unless (not (tramp--test-crypt-p))) + (skip-unless (tramp--test-supports-environment-variables-p)) (dolist (this-shell-command-to-string (append @@ -7797,6 +7796,11 @@ This requires restrictions of file name syntax." (tramp--test-sh-p) (tramp--test-smb-p) (tramp--test-sudoedit-p))) +(defun tramp--test-supports-environment-variables-p () + "Return whether setting environment variables is supported." + (and (tramp--test-sh-p) + (not (tramp--test-crypt-p)))) + (defun tramp--test-check-files (&rest files) "Run a simple but comprehensive test over every file in FILES." (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil)))