summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2014-02-24 16:48:32 +0100
committerMichael Albinus <michael.albinus@gmx.de>2014-02-24 16:48:32 +0100
commitc848881f79911704f71d40f02dcd0ecdcfcc98ef (patch)
treecfb5315b097b7d32e9c7ed735790beea9bc1da2c
parent0e38ae052eb194ac509b77ba9be4b0ab70c784f4 (diff)
downloademacs-c848881f79911704f71d40f02dcd0ecdcfcc98ef.tar.gz
* net/tramp-sh.el (tramp-sh-handle-file-truename): Improve last fix.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/net/tramp-sh.el13
2 files changed, 13 insertions, 4 deletions
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 <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-file-truename): Improve last fix.
+
2014-02-24 Nicolas Richard <theonewiththeevillook@yahoo.fr>
* 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.