diff --git a/src/builtin.cpp b/src/builtin.cpp index 18a5f37cf..62dd4623e 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -496,8 +496,8 @@ void builtin_init() { bool builtin_exists(const wcstring &cmd) { return static_cast(builtin_lookup(cmd)); } /// Is the command a keyword we need to special-case the handling of `-h` and `--help`. -static const wcstring_list_t help_builtins({L"for", L"while", L"function", L"if", L"end", L"switch", - L"case"}); +static const wchar_t *const help_builtins[] = {L"for", L"while", L"function", L"if", + L"end", L"switch", L"case"}; static bool cmd_needs_help(const wchar_t *cmd) { return contains(help_builtins, cmd); } /// Execute a builtin command diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 8a4eaec1e..aea3801dc 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -68,7 +68,7 @@ static const struct woption long_options[] = { _(L"%ls: Universal variable '%ls' is shadowed by the global variable of the same name.\n") // Test if the specified variable should be subject to path validation. -static const wcstring_list_t path_variables({L"PATH", L"CDPATH"}); +static const wchar_t *const path_variables[] = {L"PATH", L"CDPATH"}; static int is_path_variable(const wchar_t *env) { return contains(path_variables, env); } static int parse_cmd_opts(set_cmd_opts_t &opts, int *optind, //!OCLINT(high ncss method) diff --git a/src/env.cpp b/src/env.cpp index ed9df2b5e..635dffcb7 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -424,7 +424,7 @@ bool term_supports_setting_title() { return can_set_term_title; } /// One situation in which this breaks down is with screen, since screen supports setting the /// terminal title if the underlying terminal does so, but will print garbage on terminals that /// don't. Since we can't see the underlying terminal below screen there is no way to fix this. -static const wcstring_list_t title_terms({L"xterm", L"screen", L"tmux", L"nxterm", L"rxvt"}); +static const wchar_t *const title_terms[] = {L"xterm", L"screen", L"tmux", L"nxterm", L"rxvt"}; static bool does_term_support_setting_title() { const auto term_var = env_get(L"TERM"); if (term_var.missing_or_empty()) return false; diff --git a/src/parser_keywords.cpp b/src/parser_keywords.cpp index 12676c266..98d400325 100644 --- a/src/parser_keywords.cpp +++ b/src/parser_keywords.cpp @@ -11,18 +11,19 @@ bool parser_keywords_skip_arguments(const wcstring &cmd) { return cmd == L"else" || cmd == L"begin"; } -static const wcstring_list_t subcommand_keywords({L"command", L"builtin", L"while", L"exec", L"if", - L"and", L"or", L"not"}); +static const wchar_t *const subcommand_keywords[] = {L"command", L"builtin", L"while", L"exec", + L"if", L"and", L"or", L"not"}; bool parser_keywords_is_subcommand(const wcstring &cmd) { return parser_keywords_skip_arguments(cmd) || contains(subcommand_keywords, cmd); } -static const wcstring_list_t block_keywords({L"for", L"while", L"if", L"function", L"switch", - L"begin"}); +static const wchar_t *const block_keywords[] = {L"for", L"while", L"if", + L"function", L"switch", L"begin"}; bool parser_keywords_is_block(const wcstring &word) { return contains(block_keywords, word); } -static const wcstring_list_t reserved_keywords({L"end", L"case", L"else", L"return", L"continue", - L"break", L"argparse", L"read", L"set", L"status", L"test", L"["}); +static const wchar_t *const reserved_keywords[] = {L"end", L"case", L"else", L"return", + L"continue", L"break", L"argparse", L"read", + L"set", L"status", L"test", L"["}; bool parser_keywords_is_reserved(const wcstring &word) { return parser_keywords_is_block(word) || parser_keywords_is_subcommand(word) || contains(reserved_keywords, word);