forked from aniani/vim
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)
This commit is contained in:
@@ -1174,14 +1174,14 @@ f_glob(typval_T *argvars, typval_T *rettv)
|
|||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||||
{
|
{
|
||||||
if (tv_get_number_chk(&argvars[1], &error))
|
if (tv_get_bool_chk(&argvars[1], &error))
|
||||||
options |= WILD_KEEP_ALL;
|
options |= WILD_KEEP_ALL;
|
||||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||||
{
|
{
|
||||||
if (tv_get_number_chk(&argvars[2], &error))
|
if (tv_get_bool_chk(&argvars[2], &error))
|
||||||
rettv_list_set(rettv, NULL);
|
rettv_list_set(rettv, NULL);
|
||||||
if (argvars[3].v_type != VAR_UNKNOWN
|
if (argvars[3].v_type != VAR_UNKNOWN
|
||||||
&& tv_get_number_chk(&argvars[3], &error))
|
&& tv_get_bool_chk(&argvars[3], &error))
|
||||||
options |= WILD_ALLLINKS;
|
options |= WILD_ALLLINKS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1509,6 +1509,10 @@ def Test_getreg()
|
|||||||
assert_equal(lines, getreg('a', true, true))
|
assert_equal(lines, getreg('a', true, true))
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_glob()
|
||||||
|
assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true))
|
||||||
|
enddef
|
||||||
|
|
||||||
def Test_recursive_call()
|
def Test_recursive_call()
|
||||||
assert_equal(6765, Fibonacci(20))
|
assert_equal(6765, Fibonacci(20))
|
||||||
enddef
|
enddef
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1574,
|
||||||
/**/
|
/**/
|
||||||
1573,
|
1573,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user