diff options
| author | Eli Zaretskii | 2025-05-24 16:25:34 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2025-05-24 16:25:34 +0300 |
| commit | 463787c4e9a36d9218aaffacbfc85936e0ad86c8 (patch) | |
| tree | bb25946bbff29396565a0b93a7dba2455f6ef236 | |
| parent | 056ba8c569ca1a9757d48043a6a211c83087b678 (diff) | |
| download | emacs-463787c4e9a36d9218aaffacbfc85936e0ad86c8.tar.gz emacs-463787c4e9a36d9218aaffacbfc85936e0ad86c8.zip | |
Fix detection of Dired with files whose name ends in a colon
* lisp/dired.el (dired-build-subdir-alist): Use a more general
regexp to detect file entries whose names end in a colon, when
various non-default 'ls' switches are used. (Bug#78493)
| -rw-r--r-- | lisp/dired.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 63d373a63dc..4ae3eaf0d98 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3721,7 +3721,13 @@ instead of `dired-actual-switches'." | |||
| 3721 | ;; ange-ftp listings. | 3721 | ;; ange-ftp listings. |
| 3722 | (and (dired-switches-recursive-p switches) | 3722 | (and (dired-switches-recursive-p switches) |
| 3723 | (string-match "\\`/.*:\\(/.*\\)" default-directory) | 3723 | (string-match "\\`/.*:\\(/.*\\)" default-directory) |
| 3724 | (concat "\\`" (match-string 1 default-directory))))) | 3724 | (concat "\\`" (match-string 1 default-directory)))) |
| 3725 | ;; Regexp that describes the beginning of line of a | ||
| 3726 | ;; file/directory entry (as opposed to a subdirectory | ||
| 3727 | ;; heading), including the optional mark, inode, and size. | ||
| 3728 | (file-entry-beg-re (concat dired-re-maybe-mark | ||
| 3729 | dired-re-inode-size | ||
| 3730 | dired-re-perms))) | ||
| 3725 | (goto-char (point-min)) | 3731 | (goto-char (point-min)) |
| 3726 | (setq dired-subdir-alist nil) | 3732 | (setq dired-subdir-alist nil) |
| 3727 | (while (re-search-forward dired-subdir-regexp nil t) | 3733 | (while (re-search-forward dired-subdir-regexp nil t) |
| @@ -3730,8 +3736,7 @@ instead of `dired-actual-switches'." | |||
| 3730 | (unless (save-excursion | 3736 | (unless (save-excursion |
| 3731 | (goto-char (match-beginning 0)) | 3737 | (goto-char (match-beginning 0)) |
| 3732 | (beginning-of-line) | 3738 | (beginning-of-line) |
| 3733 | (forward-char 2) | 3739 | (looking-at-p file-entry-beg-re)) |
| 3734 | (looking-at-p dired-re-perms)) | ||
| 3735 | (save-excursion | 3740 | (save-excursion |
| 3736 | (goto-char (match-beginning 1)) | 3741 | (goto-char (match-beginning 1)) |
| 3737 | (setq new-dir-name | 3742 | (setq new-dir-name |