diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2010-02-18 11:08:48 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2010-02-18 11:08:48 +0100 |
commit | 73a37a6958c1cb93dafacc4c778567c239f2b171 (patch) | |
tree | 644a6fccab0f49371aed7c519a29477ec9f1a271 | |
parent | 6e4f5731f6620d147d4937ed2be2544720e01041 (diff) | |
download | emacs-73a37a6958c1cb93dafacc4c778567c239f2b171.tar.gz |
(tramp-handle-directory-files): When FULL, do not expand "." and "..".
Reported by Thierry Volpiatto <thierry.volpiatto@gmail.com>.
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/net/tramp.el | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8f531fcaec2..45117eb671f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2010-02-18 Michael Albinus <michael.albinus@gmx.de> + * net/tramp.el (tramp-handle-directory-files): When FULL, do not + expand "." and "..". Reported by Thierry Volpiatto + <thierry.volpiatto@gmail.com>. + +2010-02-18 Michael Albinus <michael.albinus@gmx.de> + * net/tramp.el (tramp-handle-insert-file-contents): Set always the permissions of the temporary file to "0600". In case the remote file has no read permissions for the owner, there might be diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d15d245d01f..eed5a41e46d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3142,7 +3142,7 @@ value of `default-file-modes', without execute permissions." "Like `directory-files' for Tramp files." ;; FILES-ONLY is valid for XEmacs only. (when (file-directory-p directory) - (setq directory (expand-file-name directory)) + (setq directory (file-name-as-directory (expand-file-name directory))) (let ((temp (nreverse (file-name-all-completions "" directory))) result item) @@ -3150,13 +3150,13 @@ value of `default-file-modes', without execute permissions." (setq item (directory-file-name (pop temp))) (when (and (or (null match) (string-match match item)) (or (null files-only) - ;; files only + ;; Files only. (and (equal files-only t) (file-regular-p item)) - ;; directories only + ;; Directories only. (file-directory-p item))) - (push (if full (expand-file-name item directory) item) + (push (if full (concat directory item) item) result))) - result))) + (if nosort result (sort result 'string<))))) (defun tramp-handle-directory-files-and-attributes (directory &optional full match nosort id-format) |