diff options
author | nicm <nicm> | 2019-05-20 11:46:06 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-05-20 11:46:06 +0000 |
commit | e128c7fcd8441f3fa885eafc9328f0937cc7384c (patch) | |
tree | 2cd1ef8259cb2bcc22e52425d4515d2a7d1bd100 /cmd-confirm-before.c | |
parent | 8db89f8efba007bab51dd8b8979a828730892f56 (diff) |
Replace the various identical error callbacks with a single one in cmd-queue.c.
Diffstat (limited to 'cmd-confirm-before.c')
-rw-r--r-- | cmd-confirm-before.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c index 7036d34b..4017a6f9 100644 --- a/cmd-confirm-before.c +++ b/cmd-confirm-before.c @@ -82,17 +82,6 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_NORMAL); } -static enum cmd_retval -cmd_confirm_before_error(struct cmdq_item *item, void *data) -{ - char *error = data; - - cmdq_error(item, "%s", error); - free(error); - - return (CMD_RETURN_NORMAL); -} - static int cmd_confirm_before_callback(struct client *c, void *data, const char *s, __unused int done) @@ -112,11 +101,11 @@ cmd_confirm_before_callback(struct client *c, void *data, const char *s, cmdlist = cmd_string_parse(cdata->cmd, NULL, 0, &cause); if (cmdlist == NULL) { - if (cause != NULL) { - new_item = cmdq_get_callback(cmd_confirm_before_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); |