mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:8.2.4453: :helpgrep may free an option that was not allocated
Problem: :helpgrep may free an option that was not allocated. (Yegappan
Lakshmanan)
Solution: Check if the value was allocated.
4791fcd825
This commit is contained in:
@@ -3112,6 +3112,12 @@ void set_option_value_give_err(const char *name, long number, const char *string
|
||||
}
|
||||
}
|
||||
|
||||
bool is_option_allocated(const char *name)
|
||||
{
|
||||
int idx = findoption(name);
|
||||
return idx >= 0 && (options[idx].flags & P_ALLOCED);
|
||||
}
|
||||
|
||||
/// Return true if "name" is a string option.
|
||||
/// Returns false if option "name" does not exist.
|
||||
bool is_string_option(const char *name)
|
||||
|
Reference in New Issue
Block a user