diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-15 07:50:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-15 07:50:34 +0000 |
commit | ca617d679ff296a4abe0e7526d8e8cab4f87e338 (patch) | |
tree | c854ff73d8b545170ef71d2966524dcbd946720a /cmd-show-window-options.c | |
parent | 615d85fb23e8eea75d3c630eccc21e98dd8a8ec7 (diff) |
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.
Diffstat (limited to 'cmd-show-window-options.c')
-rw-r--r-- | cmd-show-window-options.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd-show-window-options.c b/cmd-show-window-options.c index 9fd35177..4365b098 100644 --- a/cmd-show-window-options.c +++ b/cmd-show-window-options.c @@ -49,7 +49,6 @@ cmd_show_window_options_exec(struct cmd *self, struct cmd_ctx *ctx) struct winlink *wl; struct options *oo; const struct set_option_entry *entry; - u_int i; char *vs; long long vn; @@ -61,9 +60,7 @@ cmd_show_window_options_exec(struct cmd *self, struct cmd_ctx *ctx) oo = &wl->window->options; } - for (i = 0; i < NSETWINDOWOPTION; i++) { - entry = &set_window_option_table[i]; - + for (entry = set_window_option_table; entry->name != NULL; entry++) { if (options_find1(oo, entry->name) == NULL) continue; |