summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-22 16:09:06 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-22 16:09:06 +0100
commitba0a7475c52ea0ba9e083934bd328fbcbfa8d532 (patch)
treeba830746e37547f07efa64c68528eee1f77f225b /src/channel.c
parent64e74c9cc7d5aab215cf72d9bdd3aac32e128191 (diff)
downloadvim-git-ba0a7475c52ea0ba9e083934bd328fbcbfa8d532.tar.gz
patch 8.2.0031: MS-Windows: test for empty job failsv8.2.0031
Problem: MS-Windows: test for empty job fails Solution: Check for error message, make it also fail on Unix.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index aed234c3a..f1c2ccd33 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -5943,11 +5943,19 @@ job_start(
if (build_argv_from_list(l, &argv, &argc) == FAIL)
goto theend;
-#ifndef USE_ARGV
+
+ // Empty command is invalid.
+#ifdef USE_ARGV
+ if (argc == 0 || *skipwhite((char_u *)argv[0]) == NUL)
+ {
+ emsg(_(e_invarg));
+ goto theend;
+ }
+#else
if (win32_build_cmd(l, &ga) == FAIL)
goto theend;
cmd = ga.ga_data;
- if (cmd == NULL)
+ if (cmd == NULL || *skipwhite(cmd) == NUL)
{
emsg(_(e_invarg));
goto theend;