aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2014-11-06 17:29:32 +0300
committerZyX <kp-pav@yandex.ru>2016-04-18 02:43:43 +0300
commit9261f1597ff9ffbbb546dc308bdeaabd191577e9 (patch)
treebdfc9bb1224559bf4a4a397b12f77ff074e46252
parent1168dbe3435580f872ae9cd44648f3b3a881896c (diff)
downloadrneovim-9261f1597ff9ffbbb546dc308bdeaabd191577e9.tar.gz
rneovim-9261f1597ff9ffbbb546dc308bdeaabd191577e9.tar.bz2
rneovim-9261f1597ff9ffbbb546dc308bdeaabd191577e9.zip
option: Use findoption_len in do_set
-rw-r--r--src/nvim/option.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index f3cd144386..fe205f4e63 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1177,10 +1177,9 @@ do_set (
errmsg = e_invarg;
goto skip;
}
- arg[len] = NUL; /* put NUL after name */
if (arg[1] == 't' && arg[2] == '_') /* could be term code */
- opt_idx = findoption(arg + 1);
- arg[len++] = '>'; /* restore '>' */
+ opt_idx = findoption_len(arg + 1, (size_t) (len - 1));
+ len++;
if (opt_idx == -1)
key = find_key_option(arg + 1);
} else {
@@ -1193,10 +1192,7 @@ do_set (
else
while (ASCII_ISALNUM(arg[len]) || arg[len] == '_')
++len;
- nextchar = arg[len];
- arg[len] = NUL; /* put NUL after name */
- opt_idx = findoption(arg);
- arg[len] = nextchar; /* restore nextchar */
+ opt_idx = findoption_len(arg, (size_t) len);
if (opt_idx == -1)
key = find_key_option(arg);
}