From 34cb0879551b8217db820f684d913a393f4f38cb Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 30 May 2021 22:50:09 +0100 Subject: 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. --- src/nvim/ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 3f0d85dc88..77432149ce 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -5017,7 +5017,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1) 0 + (do_bin ? STR2NR_BIN : 0) + (do_oct ? STR2NR_OCT : 0) + (do_hex ? STR2NR_HEX : 0), - NULL, &n, maxlen); + NULL, &n, maxlen, false); // ignore leading '-' for hex, octal and bin numbers if (pre && negative) { -- cgit