Patch 8.2.1574

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 2, 2020, 3:54:09 PM9/2/20
to vim...@googlegroups.com

Patch 8.2.1574
Problem: Vim9: glob() doesnot take "true" as argument.
Solution: Use tv_get_bool_chk(). (closes #6821)
Files: src/filepath.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1573/src/filepath.c 2020-08-19 16:00:02.086372657 +0200
--- src/filepath.c 2020-09-02 21:50:50.923429866 +0200
***************
*** 1174,1187 ****
rettv->v_type = VAR_STRING;
if (argvars[1].v_type != VAR_UNKNOWN)
{
! if (tv_get_number_chk(&argvars[1], &error))
options |= WILD_KEEP_ALL;
if (argvars[2].v_type != VAR_UNKNOWN)
{
! if (tv_get_number_chk(&argvars[2], &error))
rettv_list_set(rettv, NULL);
if (argvars[3].v_type != VAR_UNKNOWN
! && tv_get_number_chk(&argvars[3], &error))
options |= WILD_ALLLINKS;
}
}
--- 1174,1187 ----
rettv->v_type = VAR_STRING;
if (argvars[1].v_type != VAR_UNKNOWN)
{
! if (tv_get_bool_chk(&argvars[1], &error))
options |= WILD_KEEP_ALL;
if (argvars[2].v_type != VAR_UNKNOWN)
{
! if (tv_get_bool_chk(&argvars[2], &error))
rettv_list_set(rettv, NULL);
if (argvars[3].v_type != VAR_UNKNOWN
! && tv_get_bool_chk(&argvars[3], &error))
options |= WILD_ALLLINKS;
}
}
*** ../vim-8.2.1573/src/testdir/test_vim9_func.vim 2020-09-02 21:45:50.404307575 +0200
--- src/testdir/test_vim9_func.vim 2020-09-02 21:50:25.875502869 +0200
***************
*** 1509,1514 ****
--- 1509,1518 ----
assert_equal(lines, getreg('a', true, true))
enddef

+ def Test_glob()
+ assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true))
+ enddef
+
def Test_recursive_call()
assert_equal(6765, Fibonacci(20))
enddef
*** ../vim-8.2.1573/src/version.c 2020-09-02 21:45:50.404307575 +0200
--- src/version.c 2020-09-02 21:50:05.755561556 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1574,
/**/

--
GUARD #2: It could be carried by an African swallow!
GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow,
that's my point.
GUARD #2: Oh, yeah, I agree with that...
The Quest for the Holy Grail (Monty Python)

/// 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 ///
Reply all
Reply to author
Forward
0 new messages