mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
updated for version 7.4.233
Problem: Escaping special characters for using "%" with a shell command is inconsistant, parenthesis are escaped but spaces are not. Solution: Only escape "!". (Gary Johnson)
This commit is contained in:
@@ -4580,25 +4580,15 @@ expand_filename(eap, cmdlinep, errormsgp)
|
||||
|
||||
/* For a shell command a '!' must be escaped. */
|
||||
if ((eap->usefilter || eap->cmdidx == CMD_bang)
|
||||
&& vim_strpbrk(repl, (char_u *)"!&;()<>") != NULL)
|
||||
&& vim_strpbrk(repl, (char_u *)"!") != NULL)
|
||||
{
|
||||
char_u *l;
|
||||
|
||||
l = vim_strsave_escaped(repl, (char_u *)"!&;()<>");
|
||||
l = vim_strsave_escaped(repl, (char_u *)"!");
|
||||
if (l != NULL)
|
||||
{
|
||||
vim_free(repl);
|
||||
repl = l;
|
||||
/* For a sh-like shell escape "!" another time. */
|
||||
if (strstr((char *)p_sh, "sh") != NULL)
|
||||
{
|
||||
l = vim_strsave_escaped(repl, (char_u *)"!");
|
||||
if (l != NULL)
|
||||
{
|
||||
vim_free(repl);
|
||||
repl = l;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user