1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 06:50:23 -08:00

Fix dired quoting bug with "HitNHide"

Fixes Bug#19498.
* files.el (shell-quote-wildcard-pattern): Also quote "`".
This commit is contained in:
Paul Eggert 2015-01-04 13:45:07 -08:00
parent 5981b4b1c0
commit 031eadcbed
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2015-01-04 Paul Eggert <eggert@cs.ucla.edu>
Fix dired quoting bug with "Hit`N`Hide"
Fixes Bug#19498.
* files.el (shell-quote-wildcard-pattern): Also quote "`".
2015-01-04 Dmitry Gutov <dgutov@yandex.ru> 2015-01-04 Dmitry Gutov <dgutov@yandex.ru>
Unbreak `mouse-action' property in text buttons. Unbreak `mouse-action' property in text buttons.

View file

@ -6051,7 +6051,7 @@ and `list-directory-verbose-switches'."
PATTERN is assumed to represent a file-name wildcard suitable for the PATTERN is assumed to represent a file-name wildcard suitable for the
underlying filesystem. For Unix and GNU/Linux, each character from the underlying filesystem. For Unix and GNU/Linux, each character from the
set [ \\t\\n;<>&|()'\"#$] is quoted with a backslash; for DOS/Windows, all set [ \\t\\n;<>&|()`'\"#$] is quoted with a backslash; for DOS/Windows, all
the parts of the pattern which don't include wildcard characters are the parts of the pattern which don't include wildcard characters are
quoted with double quotes. quoted with double quotes.
@ -6065,12 +6065,12 @@ need to be passed verbatim to shell commands."
;; argument has quotes, we can safely assume it is already ;; argument has quotes, we can safely assume it is already
;; quoted by the caller. ;; quoted by the caller.
(if (or (string-match "[\"]" pattern) (if (or (string-match "[\"]" pattern)
;; We quote [&()#$'] in case their shell is a port of a ;; We quote [&()#$`'] in case their shell is a port of a
;; Unixy shell. We quote [,=+] because stock DOS and ;; Unixy shell. We quote [,=+] because stock DOS and
;; Windows shells require that in some cases, such as ;; Windows shells require that in some cases, such as
;; passing arguments to batch files that use positional ;; passing arguments to batch files that use positional
;; arguments like %1. ;; arguments like %1.
(not (string-match "[ \t;&()#$',=+]" pattern))) (not (string-match "[ \t;&()#$`',=+]" pattern)))
pattern pattern
(let ((result "\"") (let ((result "\"")
(beg 0) (beg 0)
@ -6085,7 +6085,7 @@ need to be passed verbatim to shell commands."
(concat result (substring pattern beg) "\"")))) (concat result (substring pattern beg) "\""))))
(t (t
(let ((beg 0)) (let ((beg 0))
(while (string-match "[ \t\n;<>&|()'\"#$]" pattern beg) (while (string-match "[ \t\n;<>&|()`'\"#$]" pattern beg)
(setq pattern (setq pattern
(concat (substring pattern 0 (match-beginning 0)) (concat (substring pattern 0 (match-beginning 0))
"\\" "\\"