comparison src/eval.c @ 21861:cd8dafe937ba v8.2.1480

patch 8.2.1480: Vim9: skip expression in search() gives error Commit: https://github.com/vim/vim/commit/e15eebd202e739ec7821a0e9c2aa72a445668bb8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 18 19:11:38 2020 +0200 patch 8.2.1480: Vim9: skip expression in search() gives error Problem: Vim9: skip expression in search() gives error. Solution: use tv_get_bool() eval_expr_to_bool(). (closes https://github.com/vim/vim/issues/6729)
author Bram Moolenaar <Bram@vim.org>
date Tue, 18 Aug 2020 19:15:04 +0200
parents fb74a3387694
children c16af87df654
comparison
equal deleted inserted replaced
21860:2b26ea27117d 21861:cd8dafe937ba
324 if (eval_expr_typval(expr, NULL, 0, &rettv) == FAIL) 324 if (eval_expr_typval(expr, NULL, 0, &rettv) == FAIL)
325 { 325 {
326 *error = TRUE; 326 *error = TRUE;
327 return FALSE; 327 return FALSE;
328 } 328 }
329 res = (tv_get_number_chk(&rettv, error) != 0); 329 res = (tv_get_bool_chk(&rettv, error) != 0);
330 clear_tv(&rettv); 330 clear_tv(&rettv);
331 return res; 331 return res;
332 } 332 }
333 333
334 /* 334 /*