# HG changeset patch # User Richard M. Stallman # Date 771719941 0 # Node ID 4561618ebf649c5097b522484dcc4c7c2dbbd411 # Parent 7967c371644f3a9e368adda77e733f53b56ddbe6 (dired-build-subdir-alist): Avoid mistaking a file name ending in a colon for a subdir header line. diff -r 7967c371644f -r 4561618ebf64 lisp/dired.el --- a/lisp/dired.el Wed Jun 15 22:16:04 1994 +0000 +++ b/lisp/dired.el Wed Jun 15 22:39:01 1994 +0000 @@ -185,6 +185,7 @@ "-[-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 @@ 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