To: vim_dev@googlegroups.com Subject: Patch 8.2.0232 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0232 Problem: The :compiler command causes a crash. (Daniel Steinberg) Solution: Do not use the script index if it isn't set. Files: src/ex_docmd.c, src/testdir/test_compiler.vim *** ../vim-8.2.0231/src/ex_docmd.c 2020-02-01 23:04:20.124422619 +0100 --- src/ex_docmd.c 2020-02-08 15:52:48.863250301 +0100 *************** *** 2495,2501 **** #ifdef FEAT_EVAL // Set flag that any command was executed, used by ex_vim9script(). ! if (getline_equal(ea.getline, ea.cookie, getsourceline)) SCRIPT_ITEM(current_sctx.sc_sid)->sn_had_command = TRUE; /* --- 2495,2502 ---- #ifdef FEAT_EVAL // Set flag that any command was executed, used by ex_vim9script(). ! if (getline_equal(ea.getline, ea.cookie, getsourceline) ! && current_sctx.sc_sid > 0) SCRIPT_ITEM(current_sctx.sc_sid)->sn_had_command = TRUE; /* *** ../vim-8.2.0231/src/testdir/test_compiler.vim 2020-02-03 21:40:00.005363654 +0100 --- src/testdir/test_compiler.vim 2020-02-08 15:53:22.091118086 +0100 *************** *** 1,6 **** --- 1,7 ---- " Test the :compiler command source check.vim + source shared.vim func Test_compiler() if !executable('perl') *************** *** 48,53 **** --- 49,63 ---- call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1]) endfunc + " Test executing :compiler from the command line, not from a script + func Test_compiler_commandline() + call system(GetVimCommandClean() .. ' --not-a-term -c "compiler gcc" -c "call writefile([b:current_compiler], ''XcompilerOut'')" -c "quit"') + call assert_equal(0, v:shell_error) + call assert_equal(["gcc"], readfile('XcompilerOut')) + + call delete('XcompilerOut') + endfunc + func Test_compiler_completion() call feedkeys(":compiler \\\"\", 'tx') call assert_match('^"compiler ant bcc .* xmlwf$', @:) *** ../vim-8.2.0231/src/version.c 2020-02-08 14:22:49.448630165 +0100 --- src/version.c 2020-02-08 15:28:23.093084970 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 232, /**/ -- A fine is a tax for doing wrong. A tax is a fine for doing well. /// Bram Moolenaar -- Bram@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 ///