=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-set-window-option.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/tmux/Attic/cmd-set-window-option.c 2009/07/14 20:20:04 1.5 --- src/usr.bin/tmux/Attic/cmd-set-window-option.c 2009/07/15 07:50:34 1.6 *************** *** 1,4 **** ! /* $OpenBSD: cmd-set-window-option.c,v 1.5 2009/07/14 20:20:04 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-set-window-option.c,v 1.6 2009/07/15 07:50:34 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 48,54 **** const char *set_option_clock_mode_style_list[] = { "12", "24", NULL }; ! const struct set_option_entry set_window_option_table[NSETWINDOWOPTION] = { { "aggressive-resize", SET_OPTION_FLAG, 0, 0, NULL }, { "automatic-rename", SET_OPTION_FLAG, 0, 0, NULL }, { "clock-mode-colour", SET_OPTION_COLOUR, 0, 0, NULL }, --- 48,54 ---- const char *set_option_clock_mode_style_list[] = { "12", "24", NULL }; ! const struct set_option_entry set_window_option_table[] = { { "aggressive-resize", SET_OPTION_FLAG, 0, 0, NULL }, { "automatic-rename", SET_OPTION_FLAG, 0, 0, NULL }, { "clock-mode-colour", SET_OPTION_COLOUR, 0, 0, NULL }, *************** *** 70,75 **** --- 70,76 ---- { "window-status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "window-status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "xterm-keys", SET_OPTION_FLAG, 0, 0, NULL }, + { NULL, 0, 0, 0, NULL } }; int *************** *** 79,85 **** struct winlink *wl; struct client *c; struct options *oo; ! const struct set_option_entry *entry; u_int i; if (data->chflags & CMD_CHFLAG('g')) --- 80,86 ---- struct winlink *wl; struct client *c; struct options *oo; ! const struct set_option_entry *entry, *opt; u_int i; if (data->chflags & CMD_CHFLAG('g')) *************** *** 96,110 **** } entry = NULL; ! for (i = 0; i < NSETWINDOWOPTION; i++) { ! if (strncmp(set_window_option_table[i].name, ! data->option, strlen(data->option)) != 0) continue; if (entry != NULL) { ctx->error(ctx, "ambiguous option: %s", data->option); return (-1); } ! entry = &set_window_option_table[i]; /* Bail now if an exact match. */ if (strcmp(entry->name, data->option) == 0) --- 97,110 ---- } entry = NULL; ! for (opt = set_window_option_table; opt->name != NULL; opt++) { ! if (strncmp(opt->name, data->option, strlen(data->option)) != 0) continue; if (entry != NULL) { ctx->error(ctx, "ambiguous option: %s", data->option); return (-1); } ! entry = opt; /* Bail now if an exact match. */ if (strcmp(entry->name, data->option) == 0)