aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2017-01-26 19:55:45 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2017-01-26 19:55:45 +0000
commitb2e909b252b644d5994e30371063e374b0915157 (patch)
treeb67a47daa508b7e0eb6fde61150b69478c74bc08 /cmd-set-option.c
parenta4367b44fbd898522f4e7b2718cea9316b1eedf9 (diff)
parent78c0b96004ce452e373c0c35d3cb1cf50f96733d (diff)
downloadrtmux-b2e909b252b644d5994e30371063e374b0915157.tar.gz
rtmux-b2e909b252b644d5994e30371063e374b0915157.tar.bz2
rtmux-b2e909b252b644d5994e30371063e374b0915157.zip
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index f7e6b730..c7cef42c 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -211,9 +211,11 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
}
if (o == NULL)
o = options_empty(oo, options_table_entry(parent));
- if (idx == -1)
+ if (idx == -1) {
+ if (!append)
+ options_array_clear(o);
options_array_assign(o, value);
- else if (options_array_set(o, idx, value, append) != 0) {
+ } else if (options_array_set(o, idx, value, append) != 0) {
cmdq_error(item, "invalid index: %s", args->argv[0]);
return (CMD_RETURN_ERROR);
}