Skip to content

Commit 5892ea1

Browse files
committed
patch 8.2.1574: Vim9: glob() doesnot take "true" as argument
Problem: Vim9: glob() doesnot take "true" as argument. Solution: Use tv_get_bool_chk(). (closes #6821)
1 parent 67ff97d commit 5892ea1

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/filepath.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,14 +1174,14 @@ f_glob(typval_T *argvars, typval_T *rettv)
11741174
rettv->v_type = VAR_STRING;
11751175
if (argvars[1].v_type != VAR_UNKNOWN)
11761176
{
1177-
if (tv_get_number_chk(&argvars[1], &error))
1177+
if (tv_get_bool_chk(&argvars[1], &error))
11781178
options |= WILD_KEEP_ALL;
11791179
if (argvars[2].v_type != VAR_UNKNOWN)
11801180
{
1181-
if (tv_get_number_chk(&argvars[2], &error))
1181+
if (tv_get_bool_chk(&argvars[2], &error))
11821182
rettv_list_set(rettv, NULL);
11831183
if (argvars[3].v_type != VAR_UNKNOWN
1184-
&& tv_get_number_chk(&argvars[3], &error))
1184+
&& tv_get_bool_chk(&argvars[3], &error))
11851185
options |= WILD_ALLLINKS;
11861186
}
11871187
}

src/testdir/test_vim9_func.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,10 @@ def Test_getreg()
15091509
assert_equal(lines, getreg('a', true, true))
15101510
enddef
15111511

1512+
def Test_glob()
1513+
assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true))
1514+
enddef
1515+
15121516
def Test_recursive_call()
15131517
assert_equal(6765, Fibonacci(20))
15141518
enddef

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1574,
757759
/**/
758760
1573,
759761
/**/

0 commit comments

Comments
 (0)