Skip to content

Commit 03d6ae4

Browse files
author
hardenedapple
committed
Use ' for patternprefix and patternpostfix not "
Because bash interprets the command we pass it, escaping characters with a single backslash when enclosed in double quotes doesn't change the command the underlying grep program recieves. If we enclose command arguments in single quotes, that disables bash expansion for that argument. This allows the escape backslash to be seen by the underlying grep program. I don't expect this will cause some escaping problems further down the line, but with shellscript you can never tell.
1 parent 39c76e1 commit 03d6ae4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugin/EasyGrep.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,8 +2344,8 @@ function! s:ConfigureGrepCommandParameters()
23442344
\ 'req_str_recurse': '-R',
23452345
\ 'req_str_caseignore': '-i',
23462346
\ 'req_str_casematch': '',
2347-
\ 'opt_str_patternprefix': '"',
2348-
\ 'opt_str_patternpostfix': '"',
2347+
\ 'opt_str_patternprefix': "'",
2348+
\ 'opt_str_patternpostfix': "'",
23492349
\ 'opt_str_wholewordprefix': '',
23502350
\ 'opt_str_wholewordpostfix': '',
23512351
\ 'opt_str_wholewordoption': '-w ',
@@ -2392,8 +2392,8 @@ function! s:ConfigureGrepCommandParameters()
23922392
\ 'req_str_recurse': '',
23932393
\ 'req_str_caseignore': '-i',
23942394
\ 'req_str_casematch': '',
2395-
\ 'opt_str_patternprefix': '"',
2396-
\ 'opt_str_patternpostfix': '"',
2395+
\ 'opt_str_patternprefix': "'",
2396+
\ 'opt_str_patternpostfix': "'",
23972397
\ 'opt_str_wholewordprefix': '',
23982398
\ 'opt_str_wholewordpostfix': '',
23992399
\ 'opt_str_wholewordoption': '-w ',
@@ -2421,8 +2421,8 @@ function! s:ConfigureGrepCommandParameters()
24212421
\ 'req_str_recurse': '',
24222422
\ 'req_str_caseignore': '-i',
24232423
\ 'req_str_casematch': '-s',
2424-
\ 'opt_str_patternprefix': '"',
2425-
\ 'opt_str_patternpostfix': '"',
2424+
\ 'opt_str_patternprefix': "'",
2425+
\ 'opt_str_patternpostfix': "'",
24262426
\ 'opt_str_wholewordprefix': '',
24272427
\ 'opt_str_wholewordpostfix': '',
24282428
\ 'opt_str_wholewordoption': '-w ',

0 commit comments

Comments
 (0)