summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-06-15 22:39:01 +0000
committerRichard M. Stallman <rms@gnu.org>1994-06-15 22:39:01 +0000
commitacf310c90d3d625c1f1e6855f4171f6609be04ea (patch)
tree06e0b431daa57fa606243d28301eaaf4ec241d1e /lisp/dired.el
parentda5667c68aa0fbc9997ff933021a2abc772bf706 (diff)
downloademacs-acf310c90d3d625c1f1e6855f4171f6609be04ea.tar.gz
(dired-build-subdir-alist): Avoid mistaking a file name
ending in a colon for a subdir header line.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 8d7c76ab08c..286e7d10dbd 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -185,6 +185,7 @@ directory name and the cdr is the actual files to list.")
"-[-r][-w].[-r][-w][xs][-r][-w]."
"-[-r][-w].[-r][-w].[-r][-w][xst]")
"\\|"))
+(defvar dired-re-perms "-[-r][-w].[-r][-w].[-r][-w].")
(defvar dired-re-dot "^.* \\.\\.?$")
(defvar dired-subdir-alist nil
@@ -1360,7 +1361,14 @@ Returns the new value of the alist."
new-dir-name)
(goto-char (point-min))
(setq dired-subdir-alist nil)
- (while (re-search-forward dired-subdir-regexp nil t)
+ (while (and (re-search-forward dired-subdir-regexp nil t)
+ ;; Avoid taking a file name ending in a colon
+ ;; as a subdir name.
+ (not (save-excursion
+ (goto-char (match-beginning 0))
+ (beginning-of-line)
+ (forward-char 2)
+ (looking-at dired-re-perms))))
(save-excursion
(goto-char (match-beginning 1))
(setq new-dir-name