vim-patch:8.2.1571: Vim9: count() third argument cannot be "true"

Problem:    Vim9: count() third argument cannot be "true".
Solution:   use tv_get_bool_chk(). (closes vim/vim#6818)

119f557230

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-08-07 15:27:52 -04:00
parent 906639e34b
commit e0cb9004ee

View File

@@ -540,7 +540,7 @@ void f_count(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
bool error = false;
if (argvars[2].v_type != VAR_UNKNOWN) {
ic = (int)tv_get_number_chk(&argvars[2], &error);
ic = (int)tv_get_bool_chk(&argvars[2], &error);
}
if (!error && argvars[0].v_type == VAR_STRING) {