Patch 8.2.0031 (after 8.2.0029)
Problem: MS-Windows: test for empty job fails
Solution: Check for error message, make it also fail on Unix.
Files: src/channel.c, src/testdir/test_channel.vim
*** ../vim-8.2.0030/src/channel.c 2019-12-21 22:21:57.388252299 +0100
--- src/channel.c 2019-12-22 16:08:44.083028982 +0100
***************
*** 5943,5953 ****
if (build_argv_from_list(l, &argv, &argc) == FAIL)
goto theend;
! #ifndef USE_ARGV
if (win32_build_cmd(l, &ga) == FAIL)
goto theend;
cmd = ga.ga_data;
! if (cmd == NULL)
{
emsg(_(e_invarg));
goto theend;
--- 5943,5961 ----
if (build_argv_from_list(l, &argv, &argc) == FAIL)
goto theend;
!
! // 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 || *skipwhite(cmd) == NUL)
{
emsg(_(e_invarg));
goto theend;
*** ../vim-8.2.0030/src/testdir/test_channel.vim 2019-12-21 22:21:57.388252299 +0100
--- src/testdir/test_channel.vim 2019-12-22 16:07:17.487344792 +0100
***************
*** 1960,1967 ****
func Test_empty_job()
" This was crashing on MS-Windows.
! let job = job_start([""])
! call WaitForAssert({-> assert_equal("dead", job_status(job))})
endfunc
" Do this last, it stops any channel log.
--- 1960,1967 ----
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:')
endfunc
" Do this last, it stops any channel log.
*** ../vim-8.2.0030/src/version.c 2019-12-22 15:38:02.350438554 +0100
--- src/version.c 2019-12-22 16:02:37.836370459 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 31,
/**/
--
Why doesn't Tarzan have a beard?
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///