From 0c6af6ddeb02686dfc754b404bd035414c3915fe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 27 Mar 2009 18:34:58 +0000 Subject: [PATCH] (ls-lisp-insert-directory): Allow for a trailing '/' when looking for "." and "..". (Bug#2801) --- lisp/ChangeLog | 5 +++++ lisp/ls-lisp.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00e5df9f5e9..d797e665d48 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-03-27 Eli Zaretskii + + * ls-lisp.el (ls-lisp-insert-directory): Allow for a trailing '/' + when looking for "." and "..". (Bug#2801) + 2009-03-27 Andreas Schwab * simple.el (shift-select-mode): Make it a defcustom. diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 0374b9bbaed..060e4011a4a 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -390,7 +390,10 @@ not contain `d', so that a full listing is expected." (setq elt (car file-alist) file-alist (cdr file-alist)) (when (and (eq (cadr elt) t) ; directory - (not (string-match "\\`\\.\\.?\\'" (car elt)))) + ;; Under -F, we have already decorated all + ;; directories, including "." and "..", with + ;; a /, so allow for that as well. + (not (string-match "\\`\\.\\.?/?\\'" (car elt)))) (setq elt (expand-file-name (car elt) dir)) (insert "\n" elt ":\n") (ls-lisp-insert-directory -- 2.39.5