changeset 107190:21bb664bb922

(tramp-handle-directory-files): When FULL, do not expand "." and "..". Reported by Thierry Volpiatto <thierry.volpiatto@gmail.com>.
author Michael Albinus <michael.albinus@gmx.de>
date Thu, 18 Feb 2010 11:08:48 +0100
parents a48b193e3b5f
children 7583dd319561 4e1df9366cdd
files lisp/ChangeLog lisp/net/tramp.el
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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  <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
--- 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)