summaryrefslogtreecommitdiff
path: root/src/filepath.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-19 13:55:01 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-19 13:55:01 +0200
commitaf8822ce085e3bd8edeb52cbb7306ddd42427d39 (patch)
tree30b4371262468b74e34bdc02d8f1be430f7432c4 /src/filepath.c
parent9b02d64cff7664b9643205d6e23b08da688fe87a (diff)
downloadvim-git-af8822ce085e3bd8edeb52cbb7306ddd42427d39.tar.gz
patch 8.2.1485: Vim9: readdirex() expression doesn't accept boolv8.2.1485
Problem: Vim9: readdirex() expression doesn't accept bool. Solution: Accept both -1 and bool. (closes #6737)
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/filepath.c b/src/filepath.c
index a1e281b0e..d4592eba3 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -1493,6 +1493,12 @@ readdirex_checkitem(void *context, void *item)
if (eval_expr_typval(expr, argv, 1, &rettv) == FAIL)
goto theend;
+ // We want to use -1, but also true/false should be allowed.
+ if (rettv.v_type == VAR_SPECIAL || rettv.v_type == VAR_BOOL)
+ {
+ rettv.v_type = VAR_NUMBER;
+ rettv.vval.v_number = rettv.vval.v_number == VVAL_TRUE;
+ }
retval = tv_get_number_chk(&rettv, &error);
if (error)
retval = -1;