mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.1051: cannot run terminal with spaces in argument
Problem: Cannot run terminal with spaces in argument. Solution: Accept backslash to escape space and other characters. (closes #1999)
This commit is contained in:
@@ -4094,8 +4094,17 @@ mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc)
|
||||
++*argc;
|
||||
while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
|
||||
{
|
||||
if (*p == '"')
|
||||
if (p[0] == '"')
|
||||
inquote = !inquote;
|
||||
else if (p[0] == '\\' && p[1] != NUL)
|
||||
{
|
||||
/* First pass: skip over "\ " and "\"".
|
||||
* Second pass: Remove the backslash. */
|
||||
if (i == 1)
|
||||
mch_memmove(p, p + 1, STRLEN(p));
|
||||
else
|
||||
++p;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if (*p == NUL)
|
||||
|
Reference in New Issue
Block a user