diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-20 15:02:40 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-20 15:02:40 +0100 |
commit | 98ee93bde39b608fbcdca3b246b7d2088740f7cb (patch) | |
tree | 8772ddfccea6237ae2b6635ef192ef39fe2b82e7 /cmd-command-prompt.c | |
parent | 3a7e15511ba3353588cdf61c0d195699bcb0dcbc (diff) | |
parent | 87d82170a615007bbd2f880765f222dd5c263000 (diff) | |
download | rtmux-98ee93bde39b608fbcdca3b246b7d2088740f7cb.tar.gz rtmux-98ee93bde39b608fbcdca3b246b7d2088740f7cb.tar.bz2 rtmux-98ee93bde39b608fbcdca3b246b7d2088740f7cb.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r-- | cmd-command-prompt.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index d7159ad0..a3cc22c8 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -129,17 +129,6 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_NORMAL); } -static enum cmd_retval -cmd_command_prompt_error(struct cmdq_item *item, void *data) -{ - char *error = data; - - cmdq_error(item, "%s", error); - free(error); - - return (CMD_RETURN_NORMAL); -} - static int cmd_command_prompt_callback(struct client *c, void *data, const char *s, int done) @@ -177,11 +166,11 @@ cmd_command_prompt_callback(struct client *c, void *data, const char *s, cmdlist = cmd_string_parse(new_template, NULL, 0, &cause); if (cmdlist == NULL) { - if (cause != NULL) { - new_item = cmdq_get_callback(cmd_command_prompt_error, - cause); - } else + if (cause != NULL) + new_item = cmdq_get_error(cause); + else new_item = NULL; + free(cause); } else { new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); |