changeset 22049:2b04c5bf4dc3 v8.2.1574

patch 8.2.1574: Vim9: glob() doesnot take "true" as argument Commit: https://github.com/vim/vim/commit/5892ea151197c8a6363c7ce2322d84277b97353e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 21:53:11 2020 +0200 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 https://github.com/vim/vim/issues/6821)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 22:00:05 +0200
parents 49db67830f08
children d0c7c35084c5
files src/filepath.c src/testdir/test_vim9_func.vim src/version.c
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -1174,14 +1174,14 @@ f_glob(typval_T *argvars, typval_T *rett
     rettv->v_type = VAR_STRING;
     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;
 	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);
 	    if (argvars[3].v_type != VAR_UNKNOWN
-				    && tv_get_number_chk(&argvars[3], &error))
+				    && tv_get_bool_chk(&argvars[3], &error))
 		options |= WILD_ALLLINKS;
 	}
     }
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1509,6 +1509,10 @@ def Test_getreg()
   assert_equal(lines, getreg('a', true, true))
 enddef
 
+def Test_glob()
+  assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true))
+enddef
+
 def Test_recursive_call()
   assert_equal(6765, Fibonacci(20))
 enddef
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1574,
+/**/
     1573,
 /**/
     1572,