mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-27 10:54:40 +00:00
(dired-build-subdir-alist): Avoid mistaking a file name
ending in a colon for a subdir header line.
This commit is contained in:
parent
da5667c68a
commit
acf310c90d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user