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 \<C-A>\<C-B>\"\<CR>", '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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202002081501.018F1FeB014534%40masaka.moolenaar.net.

Raspunde prin e-mail lui