From f966ce5ea24748eed10f708d4f828be44887a559 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 2 Sep 2020 21:57:07 +0200 Subject: 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) --- src/filepath.c | 6 +++--- src/testdir/test_vim9_func.vim | 4 ++++ src/version.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/filepath.c b/src/filepath.c index 9f05434f5..bdd9098b8 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -1241,14 +1241,14 @@ f_globpath(typval_T *argvars, typval_T *rettv) rettv->v_type = VAR_STRING; if (argvars[2].v_type != VAR_UNKNOWN) { - if (tv_get_number_chk(&argvars[2], &error)) + if (tv_get_bool_chk(&argvars[2], &error)) flags |= WILD_KEEP_ALL; if (argvars[3].v_type != VAR_UNKNOWN) { - if (tv_get_number_chk(&argvars[3], &error)) + if (tv_get_bool_chk(&argvars[3], &error)) rettv_list_set(rettv, NULL); if (argvars[4].v_type != VAR_UNKNOWN - && tv_get_number_chk(&argvars[4], &error)) + && tv_get_bool_chk(&argvars[4], &error)) flags |= WILD_ALLLINKS; } } diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index ac676803f..11a6ddd01 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1513,6 +1513,10 @@ def Test_glob() assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true)) enddef +def Test_globpath() + assert_equal(['./runtest.vim'], globpath('.', 'runtest.vim', true, true, true)) +enddef + def Test_recursive_call() assert_equal(6765, Fibonacci(20)) enddef diff --git a/src/version.c b/src/version.c index 5761f832e..2bf491460 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1575, /**/ 1574, /**/ -- cgit v1.2.1