diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-10-09 10:01:12 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-10-09 10:01:12 +0100 |
commit | 526e860a7a831b9bab82623e64a1b30b2b1ca5e6 (patch) | |
tree | bfeffb74ca872c2ce929d7da28c42826b987e810 /cmd-set-option.c | |
parent | fb0b2cd37ab990d859d43912e4da143f5373d496 (diff) | |
parent | 1db6d6fea6158d8d0d05e59497e40a5cfc40d068 (diff) | |
download | rtmux-526e860a7a831b9bab82623e64a1b30b2b1ca5e6.tar.gz rtmux-526e860a7a831b9bab82623e64a1b30b2b1ca5e6.tar.bz2 rtmux-526e860a7a831b9bab82623e64a1b30b2b1ca5e6.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index 491353a8..0f116b6f 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -232,6 +232,7 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, struct winlink *wl = cmdq->state.tflag.wl; struct options *oo; struct options_entry *o; + const char *target; if (args_has(args, 's')) oo = global_options; @@ -239,12 +240,28 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, self->entry == &cmd_set_window_option_entry) { if (args_has(self->args, 'g')) oo = global_w_options; - else + else if (wl == NULL) { + target = args_get(args, 't'); + if (target != NULL) { + cmdq_error(cmdq, "no such window: %s", + target); + } else + cmdq_error(cmdq, "no current window"); + return (CMD_RETURN_ERROR); + } else oo = wl->window->options; } else { if (args_has(self->args, 'g')) oo = global_s_options; - else + else if (s == NULL) { + target = args_get(args, 't'); + if (target != NULL) { + cmdq_error(cmdq, "no such session: %s", + target); + } else + cmdq_error(cmdq, "no current session"); + return (CMD_RETURN_ERROR); + } else oo = s->options; } |