From: Michael Albinus Date: Mon, 24 Feb 2014 15:48:32 +0000 (+0100) Subject: * net/tramp-sh.el (tramp-sh-handle-file-truename): Improve last fix. X-Git-Tag: emacs-24.3.90~357^2~7^2~28 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c848881f79911704f71d40f02dcd0ecdcfcc98ef;p=emacs.git * net/tramp-sh.el (tramp-sh-handle-file-truename): Improve last fix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index da0d2ea4499..c946ab6e12b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-02-24 Michael Albinus + + * net/tramp-sh.el (tramp-sh-handle-file-truename): Improve last fix. + 2014-02-24 Nicolas Richard * minibuffer.el (completion--try-word-completion): diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index efad151dac8..37e212970ce 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -938,8 +938,11 @@ target of the symlink differ." (defun tramp-sh-handle-file-truename (filename) "Like `file-truename' for Tramp files." - (with-parsed-tramp-file-name (expand-file-name filename) nil - (tramp-make-tramp-file-name method user host + (format + "%s%s" + (with-parsed-tramp-file-name (expand-file-name filename) nil + (tramp-make-tramp-file-name + method user host (with-tramp-file-property v localname "file-truename" (let ((result nil)) ; result steps in reverse order (tramp-message v 4 "Finding true name for `%s'" filename) @@ -1042,8 +1045,10 @@ target of the symlink differ." (setq result (concat result "/")))))) (tramp-message v 4 "True name of `%s' is `%s'" localname result) - (if (string-equal (file-name-nondirectory localname) "") - (file-name-as-directory result) result)))))) + result)))) + + ;; Preserve trailing "/". + (if (string-equal (file-name-nondirectory filename) "") "/" ""))) ;; Basic functions.