]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.602 v7.4.602
authorBram Moolenaar <Bram@vim.org>
Tue, 27 Jan 2015 14:58:40 +0000 (15:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 27 Jan 2015 14:58:40 +0000 (15:58 +0100)
Problem:    ":set" does not accept hex numbers as documented.
Solution:   Use vim_str2nr(). (ZyX)

runtime/doc/options.txt
src/option.c
src/version.c

index d62bb4e8e1afc15e62a46792bed2695840d43ab9..918e1b7e4d0cb5d23ece236da78cbfd4b623bb51 100644 (file)
@@ -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|.
index 3195fa8d90b312ad4629a446cf354854970add5b..e5887366b3b93e2bc84b9df067988ee86333012e 100644 (file)
@@ -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;
index 20291a789e3999d4c2fb03a03d5cc8203cebb5a2..2b4b680fba4426fd6cc67b9a40733f9c7e1c0977 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    602,
 /**/
     601,
 /**/