diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-08-20 22:01:46 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-08-20 22:01:46 +0100 |
commit | b0da0cee4d54aa64db0f49eee509a76fd89d6f68 (patch) | |
tree | 1e54ddb0b113708c46e80d342d10be74cdf7b176 /cmd-display-message.c | |
parent | 944fde7c57c4f3caebb04cfc3943a81ee9729de8 (diff) | |
parent | d589be6c65c7295880bb84cd875baab2f77d5067 (diff) | |
download | rtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.tar.gz rtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.tar.bz2 rtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-display-message.c')
-rw-r--r-- | cmd-display-message.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cmd-display-message.c b/cmd-display-message.c index 8fd6a8ff..f4d41e6c 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -68,9 +68,9 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item) struct window_pane *wp = target->wp; const char *template; char *msg, *cause; - int delay = -1; + int delay = -1, flags; struct format_tree *ft; - int flags; + u_int count = args_count(args); if (args_has(args, 'I')) { if (wp == NULL) @@ -83,7 +83,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_WAIT); } - if (args_has(args, 'F') && args->argc != 0) { + if (args_has(args, 'F') && count != 0) { cmdq_error(item, "only one of -F or argument must be given"); return (CMD_RETURN_ERROR); } @@ -97,9 +97,10 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item) } } - template = args_get(args, 'F'); - if (args->argc != 0) - template = args->argv[0]; + if (count != 0) + template = args_string(args, 0); + else + template = args_get(args, 'F'); if (template == NULL) template = DISPLAY_MESSAGE_TEMPLATE; |