summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-01-27 15:58:40 +0100
committerBram Moolenaar <Bram@vim.org>2015-01-27 15:58:40 +0100
commit18400e6430755c97eb7e31525ab4744502603731 (patch)
tree8c906e84827bd6744a2f93615f872f8b993e752d
parent0a988df731605d692892f18317c26e6ab24d3d82 (diff)
downloadvim-git-18400e6430755c97eb7e31525ab4744502603731.tar.gz
updated for version 7.4.602v7.4.602
Problem: ":set" does not accept hex numbers as documented. Solution: Use vim_str2nr(). (ZyX)
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--src/option.c16
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 16 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d62bb4e8e..918e1b7e4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -59,9 +59,7 @@ achieve special effects. These options come in three forms:
:se[t] {option}:{value}
Set string or number option to {value}.
For numeric options the value can be given in decimal,
- hex (preceded with 0x) or octal (preceded with '0')
- (hex and octal are only available for machines which
- have the strtol() function).
+ hex (preceded with 0x) or octal (preceded with '0').
The old value can be inserted by typing 'wildchar' (by
default this is a <Tab> or CTRL-E if 'compatible' is
set). See |cmdline-completion|.
diff --git a/src/option.c b/src/option.c
index 3195fa8d9..e5887366b 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4540,21 +4540,11 @@ do_set(arg, opt_flags)
goto skip;
}
}
- /* allow negative numbers (for 'undolevels') */
else if (*arg == '-' || VIM_ISDIGIT(*arg))
{
- i = 0;
- if (*arg == '-')
- i = 1;
-#ifdef HAVE_STRTOL
- value = strtol((char *)arg, NULL, 0);
- if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
- i += 2;
-#else
- value = atol((char *)arg);
-#endif
- while (VIM_ISDIGIT(arg[i]))
- ++i;
+ /* Allow negative (for 'undolevels'), octal and
+ * hex numbers. */
+ vim_str2nr(arg, NULL, &i, TRUE, TRUE, &value, NULL);
if (arg[i] != NUL && !vim_iswhite(arg[i]))
{
errmsg = e_invarg;
diff --git a/src/version.c b/src/version.c
index 20291a789..2b4b680fb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 602,
+/**/
601,
/**/
600,