Patch 8.2.1571
Problem:    Vim9: count() third argument cannot be "true".
Solution:   use tv_get_bool_chk(). (closes #6818)
Files:      src/typval.c, src/list.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1570/src/typval.c        2020-09-01 23:05:57.812835372 +0200
--- src/typval.c        2020-09-02 21:24:58.416105774 +0200
***************
*** 283,289 ****
  tv_get_bool_chk(typval_T *varp, int *denote)
  {
      return tv_get_bool_or_number_chk(varp, denote, TRUE);
- 
  }
  
  #ifdef FEAT_FLOAT
--- 283,288 ----
*** ../vim-8.2.1570/src/list.c  2020-08-21 22:36:43.662719906 +0200
--- src/list.c  2020-09-02 21:24:48.852136985 +0200
***************
*** 2167,2173 ****
      int               error = FALSE;
  
      if (argvars[2].v_type != VAR_UNKNOWN)
!       ic = (int)tv_get_number_chk(&argvars[2], &error);
  
      if (argvars[0].v_type == VAR_STRING)
      {
--- 2167,2173 ----
      int               error = FALSE;
  
      if (argvars[2].v_type != VAR_UNKNOWN)
!       ic = (int)tv_get_bool_chk(&argvars[2], &error);
  
      if (argvars[0].v_type == VAR_STRING)
      {
*** ../vim-8.2.1570/src/testdir/test_vim9_func.vim      2020-09-02 
21:02:32.304208489 +0200
--- src/testdir/test_vim9_func.vim      2020-09-02 21:26:56.983723579 +0200
***************
*** 1492,1497 ****
--- 1492,1502 ----
    endif
  enddef
  
+ def Test_count()
+   assert_equal(3, count('ABC ABC ABC', 'b', true))
+   assert_equal(0, count('ABC ABC ABC', 'b', false))
+ enddef
+ 
  def Test_recursive_call()
    assert_equal(6765, Fibonacci(20))
  enddef
*** ../vim-8.2.1570/src/version.c       2020-09-02 21:21:30.964799806 +0200
--- src/version.c       2020-09-02 21:28:03.967511309 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1571,
  /**/

-- 
This is the polymorph virus!  Follow these instructions carefully:
1. Send this message to everybody you know.
2. Format your harddisk.
Thank you for your cooperation in spreading the most powerful virus ever!

 /// 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/202009021931.082JVuln3682327%40masaka.moolenaar.net.

Raspunde prin e-mail lui