From: Lars Ingebrigtsen Date: Sun, 20 Feb 2022 13:49:41 +0000 (+0100) Subject: Quote files that start with - in dired X-Git-Tag: emacs-29.0.90~2205 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8d1dfb2af38de590244e30d3a9553679b47b3dd0;p=emacs.git Quote files that start with - in dired * lisp/dired-aux.el (dired-shell-stuff-it): Add ./ to file names that start with - (bug#10458). --- diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 41c45b4e514..2449d11c072 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