mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
option: Allow zero-length options
Code that expected NUL-terminated strings allowed them and this behaviour is actually used.
This commit is contained in:
parent
9261f1597f
commit
c0bab19cf5
@ -4309,13 +4309,12 @@ int findoption_len(const char_u *const arg, const size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
assert(len > 0);
|
||||
|
||||
/*
|
||||
* Check for name starting with an illegal character.
|
||||
*/
|
||||
if (arg[0] < 'a' || arg[0] > 'z')
|
||||
if (len == 0 || arg[0] < 'a' || arg[0] > 'z') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int opt_idx;
|
||||
is_term_opt = (len > 2 && arg[0] == 't' && arg[1] == '_');
|
||||
|
Loading…
Reference in New Issue
Block a user