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.
This commit is contained in:
Michael Albinus 2015-04-03 18:52:27 +02:00
parent c775195c62
commit 8596eb1282
2 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2015-04-03 Michael Albinus <michael.albinus@gmx.de>
* 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 <theonewiththeevillook@yahoo.fr>
* pcmpl-unix.el (pcmpl-ssh-known-hosts): Use `char-before' instead

View file

@ -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