[Top][All Lists]

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

bug#29303: 25.2; vc-git-grep should shell-escape FILES

From: Robert Pluim
Subject: bug#29303: 25.2; vc-git-grep should shell-escape FILES
Date: Wed, 15 Nov 2017 21:17:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Robert Pluim <address@hidden>
>> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
>> index ed85603f82..43164b4fcf 100644
>> --- a/lisp/vc/vc-git.el
>> +++ b/lisp/vc/vc-git.el
>> @@ -1428,7 +1428,7 @@ vc-git-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))))))
> That's okay portability-wise, but why do you need split-string?
> AFAIU, grep-read-files reads a single pattern, no?

grep-read-files has support for grep-files-aliases which allows you to
eg say 'cc' and have it expand to "*.cc *.cxx *.cpp *.C *.CC *.c++"

It's also possible to enter multiple patterns using grep-read-files,
although you have to do things like ^Q<SPC> to get a space into the
string. That might be worth fixing separately.


reply via email to

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