Subject: Re: bug#18782: 24.3; Eshell constructs bad path when executing script in current directory on remote host

From: rekado <[email-masked]>
Date: Tue, 23 Dec 2014 18:53:30 +0100

Michael Albinus writes:
> I've debugged this problem. Looks like the following patch in eshell
> solves it:
>
> --8<---------------cut here---------------start------------->8---
> *** /usr/local/src/emacs/lisp/eshell/esh-ext.el.~master~	2014-12-19 17:33:32.333535651 +0100
> --- /usr/local/src/emacs/lisp/eshell/esh-ext.el	2014-12-19 16:21:34.443196286 +0100
> ***************
> *** 296,301 ****
> --- 296,306 ----
>         (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)))
>   	(if (and fullname (not (or eshell-force-execution
>   				   (file-executable-p fullname))))
>   	    (while suffixes
> --8<---------------cut here---------------end--------------->8---
>
> Could you, please, check?

I tried this patch in Emacs 24.4 and it works for me.
Thank you.

-- rekado