diff src/channel.c @ 18941:70d6614aaf28 v8.2.0031

patch 8.2.0031: MS-Windows: test for empty job fails Commit: https://github.com/vim/vim/commit/ba0a7475c52ea0ba9e083934bd328fbcbfa8d532 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 22 16:09:06 2019 +0100 patch 8.2.0031: MS-Windows: test for empty job fails Problem: MS-Windows: test for empty job fails Solution: Check for error message, make it also fail on Unix.
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Dec 2019 16:15:04 +0100
parents ab97d1aea4aa
children d90138662f49
line wrap: on
line diff
--- 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;