]> git.eshelyaron.com Git - emacs.git/commitdiff
Shell-quote wildcards when invoking 'vc-git-grep'
authorRobert Pluim <rpluim@gmail.com>
Tue, 28 Nov 2017 17:46:38 +0000 (19:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 28 Nov 2017 17:46:38 +0000 (19:46 +0200)
* lisp/vc/vc-git.el (vc-git-grep): Apply shell quoting to
filename wildcards to ensure globbing is done by git rather
than the shell.  (Bug#29303)

lisp/vc/vc-git.el

index 6b6f0f8d12cb76046ba72dc82e9e08d16238d681..8b18c0add08a06a11e6da085b0cb67e6190bc2da 100644 (file)
@@ -1430,7 +1430,9 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
                                   nil nil 'grep-history)
             nil))
       (t (let* ((regexp (grep-read-regexp))
-               (files (grep-read-files regexp))
+               (files
+                 (mapconcat #'shell-quote-argument
+                            (split-string (grep-read-files regexp)) " "))
                (dir (read-directory-name "In directory: "
                                          nil default-directory t)))
           (list regexp files dir))))))