=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-option.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- src/usr.bin/tmux/cmd-set-option.c 2015/12/12 18:32:24 1.89 +++ src/usr.bin/tmux/cmd-set-option.c 2015/12/13 14:32:38 1.90 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-option.c,v 1.89 2015/12/12 18:32:24 nicm Exp $ */ +/* $OpenBSD: cmd-set-option.c,v 1.90 2015/12/13 14:32:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -67,8 +67,8 @@ const struct cmd_entry cmd_set_option_entry = { "set-option", "set", "agoqst:uw", 1, 2, - "[-agosquw] [-t target-session|target-window] option [value]", - 0, + "[-agosquw] [-t target-window] option [value]", + CMD_WINDOW_T|CMD_CANFAIL, cmd_set_option_exec }; @@ -76,7 +76,7 @@ "set-window-option", "setw", "agoqt:u", 1, 2, "[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]", - 0, + CMD_WINDOW_T|CMD_CANFAIL, cmd_set_option_exec }; @@ -84,12 +84,12 @@ 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 session *s = cmdq->state.tflag.s; + struct winlink *wl = cmdq->state.tflag.wl; + struct window *w; struct client *c; + const struct options_table_entry *oe; struct options *oo; - struct window *w; const char *optstr, *valstr; /* Get the option name and value. */ @@ -131,7 +131,6 @@ if (args_has(self->args, 'g')) oo = global_w_options; else { - wl = cmd_find_window(cmdq, args_get(args, 't'), NULL); if (wl == NULL) { cmdq_error(cmdq, "couldn't set '%s'%s", optstr, @@ -145,7 +144,6 @@ if (args_has(self->args, 'g')) oo = global_s_options; else { - s = cmd_find_session(cmdq, args_get(args, 't'), 0); if (s == NULL) { cmdq_error(cmdq, "couldn't set '%s'%s", optstr, @@ -209,8 +207,8 @@ const char *valstr) { struct args *args = self->args; - struct session *s; - struct winlink *wl; + struct session *s = cmdq->state.tflag.s; + struct winlink *wl = cmdq->state.tflag.wl; struct options *oo; if (args_has(args, 's')) @@ -219,21 +217,13 @@ self->entry == &cmd_set_window_option_entry) { if (args_has(self->args, 'g')) oo = global_w_options; - else { - wl = cmd_find_window(cmdq, args_get(args, 't'), NULL); - if (wl == NULL) - return (CMD_RETURN_ERROR); + else oo = wl->window->options; - } } else { if (args_has(self->args, 'g')) oo = global_s_options; - else { - s = cmd_find_session(cmdq, args_get(args, 't'), 0); - if (s == NULL) - return (CMD_RETURN_ERROR); + else oo = s->options; - } } if (args_has(args, 'u')) {