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

@@ -713,12 +713,6 @@ EXTERN char *escape_chars INIT( = " \t\\\"|"); // need backslash in cmd line
EXTERN bool keep_help_flag INIT( = false); // doing :ta from help file
// When a string option is NULL (which only happens in out-of-memory situations), it is set to
// empty_string_option, to avoid having to check for NULL everywhere.
//
// TODO(famiu): Remove this when refcounted strings are used for string options.
EXTERN char *empty_string_option INIT( = "");
EXTERN bool redir_off INIT( = false); // no redirection for a moment
EXTERN FILE *redir_fd INIT( = NULL); // message redirection file
EXTERN int redir_reg INIT( = 0); // message redirection register