From 73a37a6958c1cb93dafacc4c778567c239f2b171 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 18 Feb 2010 11:08:48 +0100 Subject: [PATCH] (tramp-handle-directory-files): When FULL, do not expand "." and "..". Reported by Thierry Volpiatto . --- lisp/ChangeLog | 6 ++++++ 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,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 --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) -- 2.39.5