refactor(options): always allocate option values (#30917)

Instead of keeping `P_ALLOCED` and `P_DEF_ALLOCED` flags to check if an
option value is allocated, always allocate option values to simplify the
logic.

Ref: #25672
This commit is contained in:
Famiu Haque
2024-10-27 19:09:24 +06:00
committed by GitHub
parent 123c0b6b4e
commit b136a9ee4c
7 changed files with 47 additions and 114 deletions

View File

@@ -250,7 +250,6 @@ void check_buf_options(buf_T *buf)
/// Free the string allocated for an option.
/// Checks for the string being empty_string_option. This may happen if we're out of memory,
/// xstrdup() returned NULL, which was replaced by empty_string_option by check_options().
/// Does NOT check for P_ALLOCED flag!
void free_string_option(char *p)
{
if (p != empty_string_option) {