]> granicus.if.org Git - vim/commitdiff
patch 8.2.0031: MS-Windows: test for empty job fails v8.2.0031
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 15:09:06 +0000 (16:09 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 15:09:06 +0000 (16:09 +0100)
Problem:    MS-Windows: test for empty job fails
Solution:   Check for error message, make it also fail on Unix.

src/channel.c
src/testdir/test_channel.vim
src/version.c

index aed234c3aca697643652fa7b7d538d60a37483da..f1c2ccd338b2c8ac14095f54f4e27bc9d3310452 100644 (file)
@@ -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;
index 24a7ae454fc3ac251496839ffe9acf426cb0e089..a7c40098d869265a09bffb957c8b2e79ed8c66b0 100644 (file)
@@ -1960,8 +1960,8 @@ endfunc
 
 func Test_empty_job()
   " This was crashing on MS-Windows.
-  let job = job_start([""])
-  call WaitForAssert({-> assert_equal("dead", job_status(job))})
+  call assert_fails('let job = job_start([""])', 'E474:')
+  call assert_fails('let job = job_start(["   "])', 'E474:')
 endfunc
 
 " Do this last, it stops any channel log.
index 9dbfd6ff4559eb90a0cfe812259cb82bdf4e887e..7e9f4a57cd3b901743c213bacf05b5ba4babd134 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    31,
 /**/
     30,
 /**/