Skip to content

Commit f966ce5

Browse files
committed
patch 8.2.1575: Vim9: globpath() doesnot take "true" as argument
Problem: Vim9: globpath() doesnot take "true" as argument. Solution: Use tv_get_bool_chk(). (closes #6821)
1 parent 5892ea1 commit f966ce5

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
@@ -1241,14 +1241,14 @@ f_globpath(typval_T *argvars, typval_T *rettv)
12411241
rettv->v_type = VAR_STRING;
12421242
if (argvars[2].v_type != VAR_UNKNOWN)
12431243
{
1244-
if (tv_get_number_chk(&argvars[2], &error))
1244+
if (tv_get_bool_chk(&argvars[2], &error))
12451245
flags |= WILD_KEEP_ALL;
12461246
if (argvars[3].v_type != VAR_UNKNOWN)
12471247
{
1248-
if (tv_get_number_chk(&argvars[3], &error))
1248+
if (tv_get_bool_chk(&argvars[3], &error))
12491249
rettv_list_set(rettv, NULL);
12501250
if (argvars[4].v_type != VAR_UNKNOWN
1251-
&& tv_get_number_chk(&argvars[4], &error))
1251+
&& tv_get_bool_chk(&argvars[4], &error))
12521252
flags |= WILD_ALLLINKS;
12531253
}
12541254
}

src/testdir/test_vim9_func.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,10 @@ def Test_glob()
15131513
assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true))
15141514
enddef
15151515

1516+
def Test_globpath()
1517+
assert_equal(['./runtest.vim'], globpath('.', 'runtest.vim', true, true, true))
1518+
enddef
1519+
15161520
def Test_recursive_call()
15171521
assert_equal(6765, Fibonacci(20))
15181522
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+
1575,
757759
/**/
758760
1574,
759761
/**/

0 commit comments

Comments
 (0)