summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-sh.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/tramp-sh.el')
-rw-r--r--lisp/net/tramp-sh.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 212be4f36a0..3f83697c6bf 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1118,8 +1118,10 @@ component is used as the target of the symlink."
(defun tramp-sh-handle-file-truename (filename)
"Like `file-truename' for Tramp files."
- (format
- "%s%s"
+ ;; Preserve trailing "/".
+ (funcall
+ (if (string-equal (file-name-nondirectory filename) "")
+ 'file-name-as-directory 'identity)
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name
method user domain host port
@@ -1223,10 +1225,7 @@ component is used as the target of the symlink."
(let (file-name-handler-alist)
(setq result (tramp-compat-file-name-quote result))))
(tramp-message v 4 "True name of `%s' is `%s'" localname result)
- result))))
-
- ;; Preserve trailing "/".
- (if (string-equal (file-name-nondirectory filename) "") "/" "")))
+ result))))))
;; Basic functions.