diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-08-30 12:00:26 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-08-30 12:00:26 +0200 |
commit | 9376ea3f6c736f62cc064088b2e020a9f89bae63 (patch) | |
tree | 0170a37cd464d0ec513c4a173bd9fd1e425646e0 /lisp/files.el | |
parent | 9ef61c17af49886d150b938f51040ff3a1da1c80 (diff) | |
download | emacs-9376ea3f6c736f62cc064088b2e020a9f89bae63.tar.gz emacs-9376ea3f6c736f62cc064088b2e020a9f89bae63.tar.bz2 emacs-9376ea3f6c736f62cc064088b2e020a9f89bae63.zip |
Improve symlinks for Tramp
* lisp/files.el (files--splice-dirname-file): Quote whole file.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link):
Do not expand TARGET, it could be remote.
(tramp-sh-handle-file-truename): Check for cyclic symlink also
in case of readlink. Quote result if it looks remote.
(tramp-sh-handle-file-local-copy): Use `file-truename'.
* test/lisp/net/tramp-tests.el (tramp-test08-file-local-copy)
(tramp-test09-insert-file-contents): Test also file missing.
(tramp-test21-file-links): Extend test.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index 7754be29643..8cec3d45dce 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1165,7 +1165,8 @@ directory name and leading `~' and `/:' are not special in FILE." (if (eq (find-file-name-handler dirname 'file-symlink-p) (find-file-name-handler file 'file-symlink-p)) file - (file-name-quote file)) + ;; If `file' is remote, we want to quote it at the beginning. + (let (file-name-handler-alist) (file-name-quote file))) (concat dirname file))) (defun file-truename (filename &optional counter prev-dirs) |