vim-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 vim/vim#6819)

551d25e765

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-08-08 00:14:58 -04:00
parent 390e90bba4
commit e4a96c16c9

View File

@@ -1293,7 +1293,7 @@ static void f_expand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
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) {
tv_list_set_ret(rettv, NULL);
}
@@ -1324,7 +1324,7 @@ static void f_expand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
// 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) {