diff options
author | Thomas Adam <thomas@xteddy.org> | 2017-04-25 14:01:16 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2017-04-25 14:01:16 +0100 |
commit | 6ac39d5cdbd3c5910b622f58d9b6dd32e15098e2 (patch) | |
tree | 4df4ff2407a5db3fefb3591d1bf23e170055e1ea | |
parent | 9794c03537a2f7fa5787f9ed7f70c10899deca14 (diff) | |
parent | eb6fd6ff80af989ca5a2d5161f6b8de460f4c575 (diff) | |
download | rtmux-6ac39d5cdbd3c5910b622f58d9b6dd32e15098e2.tar.gz rtmux-6ac39d5cdbd3c5910b622f58d9b6dd32e15098e2.tar.bz2 rtmux-6ac39d5cdbd3c5910b622f58d9b6dd32e15098e2.zip |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-if-shell.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 580526f8..2400b3b4 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -31,7 +31,6 @@ static enum cmd_retval cmd_if_shell_exec(struct cmd *, struct cmdq_item *); -static enum cmd_retval cmd_if_shell_error(struct cmdq_item *, void *); static void cmd_if_shell_callback(struct job *); static void cmd_if_shell_free(void *); @@ -138,17 +137,6 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_WAIT); } -static enum cmd_retval -cmd_if_shell_error(struct cmdq_item *item, void *data) -{ - char *error = data; - - cmdq_error(item, "%s", error); - free(error); - - return (CMD_RETURN_NORMAL); -} - static void cmd_if_shell_callback(struct job *job) { @@ -168,10 +156,10 @@ cmd_if_shell_callback(struct job *job) cmdlist = cmd_string_parse(cmd, file, line, &cause); if (cmdlist == NULL) { - if (cause != NULL) - new_item = cmdq_get_callback(cmd_if_shell_error, cause); - else - new_item = NULL; + if (cause != NULL && cdata->item != NULL) + cmdq_error(cdata->item, "%s", cause); + free(cause); + new_item = NULL; } else { new_item = cmdq_get_command(cmdlist, NULL, &cdata->mouse, 0); cmd_list_free(cmdlist); |