aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-11-21 14:24:33 +0000
committerThomas Adam <thomas@xteddy.org>2015-11-21 14:24:33 +0000
commit78a00c845cc4d4e80f36f7cda71e0ca9ea13dcf4 (patch)
tree293ff608c1e12ad04b811b5410beb8bd50386c49 /cmd-set-option.c
parent2c482939fdd92f1bd187cdcc661890dfa4e45512 (diff)
parent933929cd622478bb43afe590670613da2e9ff359 (diff)
downloadrtmux-78a00c845cc4d4e80f36f7cda71e0ca9ea13dcf4.tar.gz
rtmux-78a00c845cc4d4e80f36f7cda71e0ca9ea13dcf4.tar.bz2
rtmux-78a00c845cc4d4e80f36f7cda71e0ca9ea13dcf4.zip
Merge branch 'obsd-master'
Conflicts: tmux.h
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 894f0c43..7de91aa2 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -84,7 +84,7 @@ enum cmd_retval
cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- const struct options_table_entry *table, *oe;
+ const struct options_table_entry *oe;
struct session *s;
struct winlink *wl;
struct client *c;
@@ -108,8 +108,8 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
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) {
+ 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,10 +124,10 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_NORMAL);
}
- /* Work out the tree from the table. */
- if (table == server_options_table)
+ /* Work out the tree from the scope of the option. */
+ if (oe->scope == OPTIONS_TABLE_SERVER)
oo = global_options;
- else if (table == window_options_table) {
+ else if (oe->scope == OPTIONS_TABLE_WINDOW) {
if (args_has(self->args, 'g'))
oo = global_w_options;
else {
@@ -141,7 +141,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
}
oo = wl->window->options;
}
- } else if (table == session_options_table) {
+ } else if (oe->scope == OPTIONS_TABLE_SESSION) {
if (args_has(self->args, 'g'))
oo = global_s_options;
else {