]> granicus.if.org Git - vim/commitdiff
patch 8.2.1575: Vim9: globpath() doesnot take "true" as argument v8.2.1575
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Sep 2020 19:57:07 +0000 (21:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Sep 2020 19:57:07 +0000 (21:57 +0200)
Problem:    Vim9: globpath() doesnot take "true" as argument.
Solution:   Use tv_get_bool_chk(). (closes #6821)

src/filepath.c
src/testdir/test_vim9_func.vim
src/version.c

index 9f05434f5d7977d98365625eeed00d90a96dd988..bdd9098b8027d12385014f37cf76821d003ba562 100644 (file)
@@ -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;
        }
     }
index ac676803f8b8f5021bb2951d32bf9a1dc62ece5f..11a6ddd01592de9a93baae5ee40f1310aa0f25ba 100644 (file)
@@ -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
index 5761f832e57ab80605150456b0ab082ece4f9612..2bf4914601a7f744c0fb48874a5223bdeaf58b68 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1575,
 /**/
     1574,
 /**/