From 8596eb1282c4d5bdb22b20c155183b39fdc8eb00 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 3 Apr 2015 18:52:27 +0200 Subject: [PATCH] Fix Bug#20249 Fixes: debbugs:20249 * net/tramp-cache.el (tramp-flush-file-property) (tramp-flush-directory-property): Use `directory-file-name' of the truename. --- lisp/ChangeLog | 6 ++++++ lisp/net/tramp-cache.el | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7a4293b16ef..5757317f5e2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-04-03 Michael Albinus + + * net/tramp-cache.el (tramp-flush-file-property) + (tramp-flush-directory-property): Use `directory-file-name' of the + truename. (Bug#20249) + 2015-04-03 Nicolas Richard * pcmpl-unix.el (pcmpl-ssh-known-hosts): Use `char-before' instead diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 1e24ea53f43..155053c5cdb 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -168,14 +168,16 @@ Returns VALUE." ;;;###tramp-autoload (defun tramp-flush-file-property (key file) "Remove all properties of FILE in the cache context of KEY." - ;; Remove file properties of symlinks. - (let ((truename (tramp-get-file-property key file "file-truename" nil))) + (let* ((file (tramp-run-real-handler + 'directory-file-name (list file))) + (truename (tramp-get-file-property key file "file-truename" nil))) + ;; Remove file properties of symlinks. (when (and (stringp truename) - (not (string-equal file truename))) + (not (string-equal file (directory-file-name truename)))) (tramp-flush-file-property key truename))) ;; Unify localname. (setq key (copy-sequence key)) - (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) + (aset key 3 file) (tramp-message key 8 "%s" file) (remhash key tramp-cache-data)) @@ -188,7 +190,7 @@ Remove also properties of all files in subdirectories." (truename (tramp-get-file-property key directory "file-truename" nil))) ;; Remove file properties of symlinks. (when (and (stringp truename) - (not (string-equal directory truename))) + (not (string-equal directory (directory-file-name truename)))) (tramp-flush-directory-property key truename)) (tramp-message key 8 "%s" directory) (maphash -- 2.11.4.GIT