summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-21 23:00:27 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-21 23:00:27 +0200
commita69b39511d769bc88f0854bd026556fdb9bd2817 (patch)
treea1ef5f17d72738d542456d44059885905f5ddf26
parent2060892028e05b1325dc0759259254180669eb5e (diff)
downloadvim-a69b39511d769bc88f0854bd026556fdb9bd2817.zip
patch 8.0.1746: MS-Windows: channel tests fail
Problem: MS-Windows: channel tests fail. Solution: Make a copy of the command before splitting it.
-rw-r--r--src/channel.c12
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index dbc7d92de..fbf1cbeb9 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -5563,6 +5563,8 @@ job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg)
#endif
if (argvars[0].v_type == VAR_STRING)
{
+ char_u *cmd_copy;
+
/* Command is a string. */
cmd = argvars[0].vval.v_string;
if (cmd == NULL || *cmd == NUL)
@@ -5570,12 +5572,18 @@ job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg)
EMSG(_(e_invarg));
goto theend;
}
- /* This will modify "cmd". */
- if (mch_parse_cmd(cmd, FALSE, &argv, &argc) == FAIL)
+ /* Make a copy, parsing will modify "cmd". */
+ cmd_copy = vim_strsave(cmd);
+ if (cmd_copy == NULL
+ || mch_parse_cmd(cmd_copy, FALSE, &argv, &argc) == FAIL)
+ {
+ vim_free(cmd_copy);
goto theend;
+ }
for (i = 0; i < argc; i++)
argv[i] = (char *)vim_strsave((char_u *)argv[i]);
argv[argc] = NULL;
+ vim_free(cmd_copy);
}
else if (argvars[0].v_type != VAR_LIST
|| argvars[0].vval.v_list == NULL
diff --git a/src/version.c b/src/version.c
index 153532227..af43697c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1746,
+/**/
1745,
/**/
1744,