Mercurial > vim
comparison src/evalfunc.c @ 22123:978f91276449 v8.2.1611
patch 8.2.1611: Vim9: cannot pass "true" to nr2char()
Commit: https://github.com/vim/vim/commit/ed6a430fae72c077ec106c9620379b69cfec3035
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 5 20:29:41 2020 +0200
patch 8.2.1611: Vim9: cannot pass "true" to nr2char()
Problem: Vim9: cannot pass "true" to nr2char().
Solution: use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6878)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Sep 2020 20:30:04 +0200 |
parents | b50610a6aee0 |
children | bd3541849208 |
comparison
equal
deleted
inserted
replaced
22122:4103523f56e4 | 22123:978f91276449 |
---|---|
5872 if (has_mbyte) | 5872 if (has_mbyte) |
5873 { | 5873 { |
5874 int utf8 = 0; | 5874 int utf8 = 0; |
5875 | 5875 |
5876 if (argvars[1].v_type != VAR_UNKNOWN) | 5876 if (argvars[1].v_type != VAR_UNKNOWN) |
5877 utf8 = (int)tv_get_number_chk(&argvars[1], NULL); | 5877 utf8 = (int)tv_get_bool_chk(&argvars[1], NULL); |
5878 if (utf8) | 5878 if (utf8) |
5879 buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL; | 5879 buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL; |
5880 else | 5880 else |
5881 buf[(*mb_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL; | 5881 buf[(*mb_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL; |
5882 } | 5882 } |