Mercurial > emacs
changeset 7918:4561618ebf64
(dired-build-subdir-alist): Avoid mistaking a file name
ending in a colon for a subdir header line.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 15 Jun 1994 22:39:01 +0000 |
parents | 7967c371644f |
children | 5823cf320f61 |
files | lisp/dired.el |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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