From: Noam Postavsky Date: Wed, 7 Jun 2017 22:48:39 +0000 (-0400) Subject: Let eshell/sudo handle absolute command names (Bug#27167) X-Git-Tag: emacs-26.0.90~521^2~131 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf557fa9c53bb8795ddc744319e067515a9dba67;p=emacs.git Let eshell/sudo handle absolute command names (Bug#27167) * lisp/eshell/esh-ext.el (eshell-find-interpreter): Don't change absolute paths into relative ones. --- diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index fb1fedc9c54..2a495225dc2 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -299,11 +299,13 @@ line of the form #!." (let ((fullname (if (file-name-directory file) file (eshell-search-path file))) (suffixes eshell-binary-suffixes)) - (if (and fullname - (not (file-remote-p fullname)) - (file-remote-p default-directory)) - (setq fullname (expand-file-name - (concat "./" fullname) default-directory))) + (when (and fullname + (not (file-remote-p fullname)) + (file-remote-p default-directory)) + (setq fullname + (if (file-name-absolute-p fullname) + (concat (file-remote-p default-directory) fullname) + (expand-file-name fullname default-directory)))) (if (and fullname (not (or eshell-force-execution (file-executable-p fullname)))) (while suffixes