Instead of separate tables for different types of options, give each

option a scope type (server, session, window) in one table.
This commit is contained in:
nicm
2015-11-20 12:01:19 +00:00
parent 374e273df5
commit fce56c56ef
6 changed files with 190 additions and 96 deletions

View File

@ -1205,19 +1205,7 @@ status_prompt_complete_list(u_int *size, const char *s)
list[(*size)++] = (*cmdent)->name;
}
}
for (oe = server_options_table; oe->name != NULL; oe++) {
if (strncmp(oe->name, s, strlen(s)) == 0) {
list = xreallocarray(list, (*size) + 1, sizeof *list);
list[(*size)++] = oe->name;
}
}
for (oe = session_options_table; oe->name != NULL; oe++) {
if (strncmp(oe->name, s, strlen(s)) == 0) {
list = xreallocarray(list, (*size) + 1, sizeof *list);
list[(*size)++] = oe->name;
}
}
for (oe = window_options_table; oe->name != NULL; oe++) {
for (oe = options_table; oe->name != NULL; oe++) {
if (strncmp(oe->name, s, strlen(s)) == 0) {
list = xreallocarray(list, (*size) + 1, sizeof *list);
list[(*size)++] = oe->name;