emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8d1dfb2af3: Quote files that start with - in dired


From: Lars Ingebrigtsen
Subject: master 8d1dfb2af3: Quote files that start with - in dired
Date: Sun, 20 Feb 2022 08:51:06 -0500 (EST)

branch: master
commit 8d1dfb2af38de590244e30d3a9553679b47b3dd0
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Quote files that start with - in dired
    
    * lisp/dired-aux.el (dired-shell-stuff-it): Add ./ to file names
    that start with - (bug#10458).
---
 lisp/dired-aux.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 41c45b4e51..2449d11c07 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -954,6 +954,13 @@ prompted for the shell command to use interactively."
                    (setq retval (replace-match x t t retval 2)))
                  retval))
            (lambda (x) (concat cmd-prefix command dired-mark-separator x)))))
+    ;; If a file name starts with "-", add a "./" to avoid the command
+    ;; interpreting it as a command line switch.
+    (setq file-list (mapcar (lambda (file)
+                              (if (string-match "\\`-" file)
+                                  (concat "./" file)
+                                file))
+                            file-list))
     (concat
      (cond
       (on-each



reply via email to

[Prev in Thread] Current Thread [Next in Thread]