Patch 8.2.2671 (after 8.2.2670)
Problem:    Error for line number in legacy script.
Solution:   Check for number type.
Files:      src/typval.c


*** ../vim-8.2.2670/src/typval.c        2021-03-28 15:46:11.547785253 +0200
--- src/typval.c        2021-03-28 16:14:12.626584820 +0200
***************
*** 1621,1631 ****
  
      if (argvars[0].v_type != VAR_STRING || !in_vim9script())
        lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
!     if (lnum < 0)  // no valid number, try using arg like line()
      {
        int     fnum;
        pos_T   *fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
  
        if (fp != NULL)
            lnum = fp->lnum;
      }
--- 1621,1632 ----
  
      if (argvars[0].v_type != VAR_STRING || !in_vim9script())
        lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
!     if (lnum <= 0 && argvars[0].v_type != VAR_NUMBER)
      {
        int     fnum;
        pos_T   *fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
  
+       // no valid number, try using arg like line()
        if (fp != NULL)
            lnum = fp->lnum;
      }
*** ../vim-8.2.2670/src/version.c       2021-03-28 15:46:11.547785253 +0200
--- src/version.c       2021-03-28 16:16:36.762137694 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2671,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
30. Even though you died last week, you've managed to retain OPS on your
    favorite IRC channel.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/202103281428.12SESRiV882939%40masaka.moolenaar.net.

Raspunde prin e-mail lui