# HG changeset patch # User Michael Albinus # Date 1266487728 -3600 # Node ID 21bb664bb9224ec2f3853c6eb1f600571f792f81 # Parent a48b193e3b5f82053db73932e34f209ee6823697 (tramp-handle-directory-files): When FULL, do not expand "." and "..". Reported by Thierry Volpiatto . diff -r a48b193e3b5f -r 21bb664bb922 lisp/ChangeLog --- a/lisp/ChangeLog Thu Feb 18 11:03:12 2010 +0100 +++ b/lisp/ChangeLog Thu Feb 18 11:08:48 2010 +0100 @@ -1,3 +1,9 @@ +2010-02-18 Michael Albinus + + * net/tramp.el (tramp-handle-directory-files): When FULL, do not + expand "." and "..". Reported by Thierry Volpiatto + . + 2010-02-18 Michael Albinus * net/tramp.el (tramp-handle-insert-file-contents): Set always the diff -r a48b193e3b5f -r 21bb664bb922 lisp/net/tramp.el --- a/lisp/net/tramp.el Thu Feb 18 11:03:12 2010 +0100 +++ b/lisp/net/tramp.el Thu Feb 18 11:08:48 2010 +0100 @@ -3142,7 +3142,7 @@ "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 @@ (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)