diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-05-30 22:50:09 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-11 15:33:19 +0100 |
commit | 34cb0879551b8217db820f684d913a393f4f38cb (patch) | |
tree | cd8c7320d91be9344cfe859c5861b475c093e565 /src/nvim/viml/parser/expressions.c | |
parent | cd18fe17a88d8144e5b841f1ca737fb4adf7885b (diff) | |
download | rneovim-34cb0879551b8217db820f684d913a393f4f38cb.tar.gz rneovim-34cb0879551b8217db820f684d913a393f4f38cb.tar.bz2 rneovim-34cb0879551b8217db820f684d913a393f4f38cb.zip |
vim-patch:8.1.1355: obvious mistakes are accepted as valid expressions
Problem: Obvious mistakes are accepted as valid expressions.
Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto,
closes vim/vim#3981)
https://github.com/vim/vim/commit/16e9b85113e0b354ece1cb4f5fcc7866850f3685
Update vim_str2nr_spec.lua to add more tests that use strict = true.
Diffstat (limited to 'src/nvim/viml/parser/expressions.c')
-rw-r--r-- | src/nvim/viml/parser/expressions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index e9d82ca87d..f5bd5479c4 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -351,7 +351,7 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags) } if (exp_start) { vim_str2nr(pline.data + exp_start, NULL, NULL, 0, NULL, &exp_part, - (int)(ret.len - exp_start)); + (int)(ret.len - exp_start), false); } if (exp_negative) { exp_part += frac_size; @@ -369,7 +369,7 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags) int len; int prep; vim_str2nr(pline.data, &prep, &len, STR2NR_ALL, NULL, - &ret.data.num.val.integer, (int)pline.size); + &ret.data.num.val.integer, (int)pline.size, false); ret.len = (size_t)len; const uint8_t bases[] = { [0] = 10, |