Commit cf557fa9 authored by Noam Postavsky's avatar Noam Postavsky
Browse files

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.
parent 517a0394
...@@ -299,11 +299,13 @@ line of the form #!<interp>." ...@@ -299,11 +299,13 @@ line of the form #!<interp>."
(let ((fullname (if (file-name-directory file) file (let ((fullname (if (file-name-directory file) file
(eshell-search-path file))) (eshell-search-path file)))
(suffixes eshell-binary-suffixes)) (suffixes eshell-binary-suffixes))
(if (and fullname (when (and fullname
(not (file-remote-p fullname)) (not (file-remote-p fullname))
(file-remote-p default-directory)) (file-remote-p default-directory))
(setq fullname (expand-file-name (setq fullname
(concat "./" fullname) default-directory))) (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 (if (and fullname (not (or eshell-force-execution
(file-executable-p fullname)))) (file-executable-p fullname))))
(while suffixes (while suffixes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment