summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2020-12-22 07:36:41 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-22 07:36:41 +0100
commit901532967873ab82d948024105b5736b622f518b (patch)
tree28662539c3333de5da6ea55cf23e0d19d36d9c93 /lisp/wdired.el
parent051d8f75350e54009180cc2fa5e5f86c92db1e13 (diff)
downloademacs-901532967873ab82d948024105b5736b622f518b.tar.gz
Fix wdired-get-filename when ls -F marks symlinks
* lisp/wdired.el (wdired-get-filename): In some systems like BSD or macOS, "ls -F" marks symlinks with a trailing "@". Add logic accounting for this so that wdired-get-filename returns the correct filename. This change also fixes test "wdired-test-bug34915" on macOS and BSD systems (bug#34915).
Diffstat (limited to 'lisp/wdired.el')
-rw-r--r--lisp/wdired.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index b7dd4ee9496..c2e1d0cafce 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -355,7 +355,10 @@ non-nil means return old filename."
dired-permission-flags-regexp nil t)
(goto-char (match-beginning 0))
(looking-at "l")
- (search-forward " -> " (line-end-position) t)))
+ (if (and used-F
+ dired-ls-F-marks-symlinks)
+ (re-search-forward "@? -> " (line-end-position) t)
+ (search-forward " -> " (line-end-position) t))))
(goto-char (match-beginning 0))
(setq end (point)))
(when (and used-F