mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 18:28:19 +00:00
option: Use findoption_len in do_set
This commit is contained in:
@@ -1177,10 +1177,9 @@ do_set (
|
|||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
arg[len] = NUL; /* put NUL after name */
|
|
||||||
if (arg[1] == 't' && arg[2] == '_') /* could be term code */
|
if (arg[1] == 't' && arg[2] == '_') /* could be term code */
|
||||||
opt_idx = findoption(arg + 1);
|
opt_idx = findoption_len(arg + 1, (size_t) (len - 1));
|
||||||
arg[len++] = '>'; /* restore '>' */
|
len++;
|
||||||
if (opt_idx == -1)
|
if (opt_idx == -1)
|
||||||
key = find_key_option(arg + 1);
|
key = find_key_option(arg + 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -1193,10 +1192,7 @@ do_set (
|
|||||||
else
|
else
|
||||||
while (ASCII_ISALNUM(arg[len]) || arg[len] == '_')
|
while (ASCII_ISALNUM(arg[len]) || arg[len] == '_')
|
||||||
++len;
|
++len;
|
||||||
nextchar = arg[len];
|
opt_idx = findoption_len(arg, (size_t) len);
|
||||||
arg[len] = NUL; /* put NUL after name */
|
|
||||||
opt_idx = findoption(arg);
|
|
||||||
arg[len] = nextchar; /* restore nextchar */
|
|
||||||
if (opt_idx == -1)
|
if (opt_idx == -1)
|
||||||
key = find_key_option(arg);
|
key = find_key_option(arg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user