summaryrefslogtreecommitdiff
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-05 17:51:23 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-05 17:51:23 +0200
commitc08cc72947fdfab484f53c5d9bbea662bc5a9c8f (patch)
treea8932d9a70fc31e6e567bba1cf56e776a3104cc1 /src/getchar.c
parent036c2cf719e3de445779a275514030be66e26883 (diff)
downloadvim-git-c08cc72947fdfab484f53c5d9bbea662bc5a9c8f.tar.gz
patch 8.2.1603: Vim9: cannot use "true" with getchar()v8.2.1603
Problem: Vim9: cannot use "true" with getchar(). Solution: use tv_get_bool_chk(). (closes #6874)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c
index a8778e0c6..4f5ea4639 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2037,7 +2037,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
if (argvars[0].v_type == VAR_UNKNOWN)
// getchar(): blocking wait.
n = plain_vgetc();
- else if (tv_get_number_chk(&argvars[0], &error) == 1)
+ else if (tv_get_bool_chk(&argvars[0], &error))
// getchar(1): only check if char avail
n = vpeekc_any();
else if (error || vpeekc_any() == NUL)