comparison src/filepath.c @ 21871:e27555ca1093 v8.2.1485

patch 8.2.1485: Vim9: readdirex() expression doesn't accept bool Commit: https://github.com/vim/vim/commit/af8822ce085e3bd8edeb52cbb7306ddd42427d39 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 19 13:55:01 2020 +0200 patch 8.2.1485: Vim9: readdirex() expression doesn't accept bool Problem: Vim9: readdirex() expression doesn't accept bool. Solution: Accept both -1 and bool. (closes https://github.com/vim/vim/issues/6737)
author Bram Moolenaar <Bram@vim.org>
date Wed, 19 Aug 2020 14:00:04 +0200
parents 42e2fb7ec6e1
children 62e61424482f
comparison
equal deleted inserted replaced
21870:e32848bb87f2 21871:e27555ca1093
1491 argv[0].vval.v_dict = dict; 1491 argv[0].vval.v_dict = dict;
1492 1492
1493 if (eval_expr_typval(expr, argv, 1, &rettv) == FAIL) 1493 if (eval_expr_typval(expr, argv, 1, &rettv) == FAIL)
1494 goto theend; 1494 goto theend;
1495 1495
1496 // We want to use -1, but also true/false should be allowed.
1497 if (rettv.v_type == VAR_SPECIAL || rettv.v_type == VAR_BOOL)
1498 {
1499 rettv.v_type = VAR_NUMBER;
1500 rettv.vval.v_number = rettv.vval.v_number == VVAL_TRUE;
1501 }
1496 retval = tv_get_number_chk(&rettv, &error); 1502 retval = tv_get_number_chk(&rettv, &error);
1497 if (error) 1503 if (error)
1498 retval = -1; 1504 retval = -1;
1499 clear_tv(&rettv); 1505 clear_tv(&rettv);
1500 1506