]> git.eshelyaron.com Git - emacs.git/commitdiff
Let eshell/sudo handle absolute command names (Bug#27167)
authorNoam Postavsky <npostavs@gmail.com>
Wed, 7 Jun 2017 22:48:39 +0000 (18:48 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 11 Jun 2017 11:39:40 +0000 (07:39 -0400)
* lisp/eshell/esh-ext.el (eshell-find-interpreter): Don't change
absolute paths into relative ones.

lisp/eshell/esh-ext.el

index fb1fedc9c54ae49a560d3e001a1f71857dbbb82d..2a495225dc2c983e1e1a576802915ec336df48db 100644 (file)
@@ -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