diff options
author | 2009-07-15 07:50:34 +0000 | |
---|---|---|
committer | 2009-07-15 07:50:34 +0000 | |
commit | 066b5252268fa567bb9d52b96c19cd3c50076ae2 (patch) | |
tree | eae01983724ef618aef1bed6299d28ba2a6df381 /usr.bin/tmux/cmd-show-window-options.c | |
parent | Add a couple of missing ';;'s in case statements. Both are just (diff) | |
download | wireguard-openbsd-066b5252268fa567bb9d52b96c19cd3c50076ae2.tar.xz wireguard-openbsd-066b5252268fa567bb9d52b96c19cd3c50076ae2.zip |
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 'usr.bin/tmux/cmd-show-window-options.c')
-rw-r--r-- | usr.bin/tmux/cmd-show-window-options.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-show-window-options.c b/usr.bin/tmux/cmd-show-window-options.c index 5d0f5b12abf..0f60512fba0 100644 --- a/usr.bin/tmux/cmd-show-window-options.c +++ b/usr.bin/tmux/cmd-show-window-options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-window-options.c,v 1.3 2009/07/13 23:11:35 nicm Exp $ */ +/* $OpenBSD: cmd-show-window-options.c,v 1.4 2009/07/15 07:50:34 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |