diff src/evalfunc.c @ 22053:0794909e2988 v8.2.1576

patch 8.2.1576: Vim9: index() does not take "true" as argument Commit: https://github.com/vim/vim/commit/6c553f9c04a698ac2e19584f8ea8e2cb7cd98c80 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 22:10:34 2020 +0200 patch 8.2.1576: Vim9: index() does not take "true" as argument Problem: Vim9: index() does not take "true" as argument. Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6823)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 22:15:03 +0200
parents ed6165395d7b
children 88bedbb4ba75
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4944,7 +4944,7 @@ f_index(typval_T *argvars, typval_T *ret
 	    item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error));
 	    idx = l->lv_u.mat.lv_idx;
 	    if (argvars[3].v_type != VAR_UNKNOWN)
-		ic = (int)tv_get_number_chk(&argvars[3], &error);
+		ic = (int)tv_get_bool_chk(&argvars[3], &error);
 	    if (error)
 		item = NULL;
 	}