]> granicus.if.org Git - vim/commitdiff
patch 8.2.0032: MS-Windows: test for blank job fails v8.2.0032
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 17:28:51 +0000 (18:28 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 17:28:51 +0000 (18:28 +0100)
Problem:    MS-Windows: test for blank job fails
Solution:   Check before escaping.

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

index f1c2ccd338b2c8ac14095f54f4e27bc9d3310452..ebbc315cc7206604c131e6575a25e902566ffce4 100644 (file)
@@ -5921,7 +5921,7 @@ job_start(
     {
        // Command is a string.
        cmd = argvars[0].vval.v_string;
-       if (cmd == NULL || *cmd == NUL)
+       if (cmd == NULL || *skipwhite(cmd) == NUL)
        {
            emsg(_(e_invarg));
            goto theend;
@@ -5945,13 +5945,12 @@ job_start(
            goto theend;
 
        // Empty command is invalid.
-#ifdef USE_ARGV
        if (argc == 0 || *skipwhite((char_u *)argv[0]) == NUL)
        {
            emsg(_(e_invarg));
            goto theend;
        }
-#else
+#ifndef USE_ARGV
        if (win32_build_cmd(l, &ga) == FAIL)
            goto theend;
        cmd = ga.ga_data;
index a7c40098d869265a09bffb957c8b2e79ed8c66b0..4dac7aaef8f3699bd5ba04017edde6df605d2160 100644 (file)
@@ -1962,6 +1962,8 @@ func Test_empty_job()
   " This was crashing on MS-Windows.
   call assert_fails('let job = job_start([""])', 'E474:')
   call assert_fails('let job = job_start(["   "])', 'E474:')
+  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 7e9f4a57cd3b901743c213bacf05b5ba4babd134..88ea9247d3834ddb426a1a7bd2e40aea113c9e0c 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    32,
 /**/
     31,
 /**/