aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-01-26 02:01:12 +0000
committerThomas Adam <thomas@xteddy.org>2017-01-26 02:01:12 +0000
commit78c0b96004ce452e373c0c35d3cb1cf50f96733d (patch)
tree213ca20e96f28dcee8b0066a9aa838bbc7838a7f /cmd-set-option.c
parentea70e68a51b52fc01656aa3b57e2af93694c62ac (diff)
parent776ce8a9d5a30bd4a8aab59c5152e78774bb805c (diff)
downloadrtmux-78c0b96004ce452e373c0c35d3cb1cf50f96733d.tar.gz
rtmux-78c0b96004ce452e373c0c35d3cb1cf50f96733d.tar.bz2
rtmux-78c0b96004ce452e373c0c35d3cb1cf50f96733d.zip
Merge branch 'obsd-master'
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);
}