summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-19 19:59:35 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-19 19:59:35 +0200
commit16e9b85113e0b354ece1cb4f5fcc7866850f3685 (patch)
tree2abe4e3cffe8b0281f0690e5570a47eb2198a826 /src/option.c
parentf5842c5a533346c4ff41ff666e465c85f1de35d5 (diff)
downloadvim-git-16e9b85113e0b354ece1cb4f5fcc7866850f3685.tar.gz
patch 8.1.1355: obvious mistakes are accepted as valid expressionsv8.1.1355
Problem: Obvious mistakes are accepted as valid expressions. Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto, closes #3981)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index a9b978079..bfdf71799 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4762,10 +4762,10 @@ do_set(
/* Allow negative (for 'undolevels'), octal and
* hex numbers. */
vim_str2nr(arg, NULL, &i, STR2NR_ALL,
- &value, NULL, 0);
- if (arg[i] != NUL && !VIM_ISWHITE(arg[i]))
+ &value, NULL, 0, TRUE);
+ if (i == 0 || (arg[i] != NUL && !VIM_ISWHITE(arg[i])))
{
- errmsg = e_invarg;
+ errmsg = N_("E521: Number required after =");
goto skip;
}
}