mirror of
https://github.com/tmux/tmux.git
synced 2025-11-03 16:46:18 +00:00
Having to update NSETOPTION/NSETWINDOWOPTION when adding new options is a bit
annoying and it is only use for iterating, so use a sentinel to mark the end of each array instead. Different fix for a problem pointed out by Kalle Olavi Niemitalo.
This commit is contained in:
8
status.c
8
status.c
@@ -898,7 +898,7 @@ status_prompt_complete(const char *s)
|
||||
const struct set_option_entry *optent;
|
||||
ARRAY_DECL(, const char *) list;
|
||||
char *prefix, *s2;
|
||||
u_int i;
|
||||
u_int i;
|
||||
size_t j;
|
||||
|
||||
if (*s == '\0')
|
||||
@@ -910,13 +910,11 @@ status_prompt_complete(const char *s)
|
||||
if (strncmp((*cmdent)->name, s, strlen(s)) == 0)
|
||||
ARRAY_ADD(&list, (*cmdent)->name);
|
||||
}
|
||||
for (i = 0; i < NSETOPTION; i++) {
|
||||
optent = &set_option_table[i];
|
||||
for (optent = set_option_table; optent->name != NULL; optent++) {
|
||||
if (strncmp(optent->name, s, strlen(s)) == 0)
|
||||
ARRAY_ADD(&list, optent->name);
|
||||
}
|
||||
for (i = 0; i < NSETWINDOWOPTION; i++) {
|
||||
optent = &set_window_option_table[i];
|
||||
for (optent = set_window_option_table; optent->name != NULL; optent++) {
|
||||
if (strncmp(optent->name, s, strlen(s)) == 0)
|
||||
ARRAY_ADD(&list, optent->name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user