diff options
author | oni-link <knil.ino@gmail.com> | 2015-09-06 08:11:29 +0200 |
---|---|---|
committer | oni-link <knil.ino@gmail.com> | 2015-09-06 08:11:29 +0200 |
commit | f39ac698241885137e77efa4edeee7be21dd8deb (patch) | |
tree | 43a6aaa4f92866ff8991e9048ec86dafe13fef9d /src | |
parent | e2cbac7634b43320b9357c4adf5db3306f87b311 (diff) | |
parent | 615e298a94fc9016a2f252aa9c474fe73bc55c1f (diff) | |
download | rneovim-f39ac698241885137e77efa4edeee7be21dd8deb.tar.gz rneovim-f39ac698241885137e77efa4edeee7be21dd8deb.tar.bz2 rneovim-f39ac698241885137e77efa4edeee7be21dd8deb.zip |
Merge pull request #3288 from oni-link/vim-7.4.602
vim-patch:7.4.602 #3288
Problem: ":set" does not accept hex numbers as documented.
Solution: Use vim_str2nr(). (ZyX)
https://github.com/vim/vim/commit/18400e6430755c97eb7e31525ab4744502603731
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 15 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 308e2a28ee..6e82c45edf 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1214,17 +1214,10 @@ do_set ( errmsg = e_invarg; goto skip; } - } - /* allow negative numbers (for 'undolevels') */ - else if (*arg == '-' || ascii_isdigit(*arg)) { - i = 0; - if (*arg == '-') - i = 1; - value = strtol((char *)arg, NULL, 0); - if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x') - i += 2; - while (ascii_isdigit(arg[i])) - ++i; + } else if (*arg == '-' || ascii_isdigit(*arg)) { + // Allow negative (for 'undolevels'), octal and + // hex numbers. + vim_str2nr(arg, NULL, &i, true, true, &value, NULL); if (arg[i] != NUL && !ascii_iswhite(arg[i])) { errmsg = e_invarg; goto skip; diff --git a/src/nvim/version.c b/src/nvim/version.c index 9a8a50ea58..8f0e6ccfff 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -319,7 +319,7 @@ static int included_patches[] = { // 605, // 604, // 603, - // 602, + 602, 601, 600, 599, |