emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master cf557fa: Let eshell/sudo handle absolute command na


From: Noam Postavsky
Subject: [Emacs-diffs] master cf557fa: Let eshell/sudo handle absolute command names (Bug#27167)
Date: Sun, 11 Jun 2017 08:40:11 -0400 (EDT)

branch: master
commit cf557fa9c53bb8795ddc744319e067515a9dba67
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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.
---
 lisp/eshell/esh-ext.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index fb1fedc..2a49522 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -299,11 +299,13 @@ line of the form #!<interp>."
       (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]