diff src/evalfunc.c @ 22045:47ff9e5be532 v8.2.1572

patch 8.2.1572: Vim9: expand() does not take "true" as argument Commit: https://github.com/vim/vim/commit/551d25e76545df785a9f62df52f34bc1dd368bfb Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 21:37:56 2020 +0200 patch 8.2.1572: Vim9: expand() does not take "true" as argument Problem: Vim9: expand() does not take "true" as argument. Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6819)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 21:45:04 +0200
parents f040df1bd219
children ed6165395d7b
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2434,7 +2434,7 @@ f_expand(typval_T *argvars, typval_T *re
     rettv->v_type = VAR_STRING;
     if (argvars[1].v_type != VAR_UNKNOWN
 	    && argvars[2].v_type != VAR_UNKNOWN
-	    && tv_get_number_chk(&argvars[2], &error)
+	    && tv_get_bool_chk(&argvars[2], &error)
 	    && !error)
 	rettv_list_set(rettv, NULL);
 
@@ -2458,7 +2458,7 @@ f_expand(typval_T *argvars, typval_T *re
 	// When the optional second argument is non-zero, don't remove matches
 	// for 'wildignore' and don't put matches for 'suffixes' at the end.
 	if (argvars[1].v_type != VAR_UNKNOWN
-				    && tv_get_number_chk(&argvars[1], &error))
+				    && tv_get_bool_chk(&argvars[1], &error))
 	    options |= WILD_KEEP_ALL;
 	if (!error)
 	{