=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-option.c,v retrieving revision 1.86 retrieving revision 1.87 diff -c -r1.86 -r1.87 *** src/usr.bin/tmux/cmd-set-option.c 2015/11/18 14:27:44 1.86 --- src/usr.bin/tmux/cmd-set-option.c 2015/11/20 12:01:19 1.87 *************** *** 1,4 **** ! /* $OpenBSD: cmd-set-option.c,v 1.86 2015/11/18 14:27:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-set-option.c,v 1.87 2015/11/20 12:01:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 84,90 **** cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; ! const struct options_table_entry *table, *oe; struct session *s; struct winlink *wl; struct client *c; --- 84,90 ---- cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; ! const struct options_table_entry *oe; struct session *s; struct winlink *wl; struct client *c; *************** *** 108,115 **** return (cmd_set_option_user(self, cmdq, optstr, valstr)); /* Find the option entry, try each table. */ ! table = oe = NULL; ! if (options_table_find(optstr, &table, &oe) != 0) { if (!args_has(args, 'q')) { cmdq_error(cmdq, "ambiguous option: %s", optstr); return (CMD_RETURN_ERROR); --- 108,115 ---- return (cmd_set_option_user(self, cmdq, optstr, valstr)); /* Find the option entry, try each table. */ ! oe = NULL; ! if (options_table_find(optstr, &oe) != 0) { if (!args_has(args, 'q')) { cmdq_error(cmdq, "ambiguous option: %s", optstr); return (CMD_RETURN_ERROR); *************** *** 124,133 **** return (CMD_RETURN_NORMAL); } ! /* Work out the tree from the table. */ ! if (table == server_options_table) oo = global_options; ! else if (table == window_options_table) { if (args_has(self->args, 'g')) oo = global_w_options; else { --- 124,133 ---- return (CMD_RETURN_NORMAL); } ! /* Work out the tree from the scope of the option. */ ! if (oe->scope == OPTIONS_TABLE_SERVER) oo = global_options; ! else if (oe->scope == OPTIONS_TABLE_WINDOW) { if (args_has(self->args, 'g')) oo = global_w_options; else { *************** *** 141,147 **** } oo = wl->window->options; } ! } else if (table == session_options_table) { if (args_has(self->args, 'g')) oo = global_s_options; else { --- 141,147 ---- } oo = wl->window->options; } ! } else if (oe->scope == OPTIONS_TABLE_SESSION) { if (args_has(self->args, 'g')) oo = global_s_options; else {