aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-06-07 18:48:39 -0400
committerNoam Postavsky2017-06-11 07:39:40 -0400
commitcf557fa9c53bb8795ddc744319e067515a9dba67 (patch)
tree3a2f29c2ec716064bedc60031280aefbab83ad7d
parent517a0394d2ba15b517e2a2b7384a7cc98b11b80d (diff)
downloademacs-cf557fa9c53bb8795ddc744319e067515a9dba67.tar.gz
emacs-cf557fa9c53bb8795ddc744319e067515a9dba67.zip
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.
-rw-r--r--lisp/eshell/esh-ext.el12
1 files changed, 7 insertions, 5 deletions
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 #!<interp>."
299 (let ((fullname (if (file-name-directory file) file 299 (let ((fullname (if (file-name-directory file) file
300 (eshell-search-path file))) 300 (eshell-search-path file)))
301 (suffixes eshell-binary-suffixes)) 301 (suffixes eshell-binary-suffixes))
302 (if (and fullname 302 (when (and fullname
303 (not (file-remote-p fullname)) 303 (not (file-remote-p fullname))
304 (file-remote-p default-directory)) 304 (file-remote-p default-directory))
305 (setq fullname (expand-file-name 305 (setq fullname
306 (concat "./" fullname) default-directory))) 306 (if (file-name-absolute-p fullname)
307 (concat (file-remote-p default-directory) fullname)
308 (expand-file-name fullname default-directory))))
307 (if (and fullname (not (or eshell-force-execution 309 (if (and fullname (not (or eshell-force-execution
308 (file-executable-p fullname)))) 310 (file-executable-p fullname))))
309 (while suffixes 311 (while suffixes