Commit acf310c9 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(dired-build-subdir-alist): Avoid mistaking a file name

ending in a colon for a subdir header line.
parent da5667c6
......@@ -185,6 +185,7 @@ directory name and the cdr is the actual files to list.")
(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."
(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))
(forward-char 2)
(looking-at dired-re-perms))))
(goto-char (match-beginning 1))
(setq new-dir-name
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment