]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix wdired-get-filename when ls -F marks symlinks
authorDaniel Martín <mardani29@yahoo.es>
Tue, 22 Dec 2020 06:36:41 +0000 (07:36 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 22 Dec 2020 06:36:41 +0000 (07:36 +0100)
* 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).

lisp/wdired.el

index b7dd4ee9496f3e0e08ebefd8bdd53b3cb5d5da94..c2e1d0cafce4fe7d677c96abe4b49960d68f51d3 100644 (file)
@@ -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