0
0
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:
Bram Moolenaar
2017-09-03 19:52:17 +02:00
parent 595a40226e
commit 9d654a8d8c
3 changed files with 31 additions and 2 deletions

View File

@@ -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)