version 1.52, 2017/04/20 09:20:22 |
version 1.53, 2017/04/21 14:01:19 |
|
|
cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) |
cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
|
struct cmdq_shared *shared = item->shared; |
struct cmd_if_shell_data *cdata; |
struct cmd_if_shell_data *cdata; |
char *shellcmd, *cmd, *cause; |
char *shellcmd, *cmd, *cause; |
struct cmd_list *cmdlist; |
struct cmd_list *cmdlist; |
|
|
} |
} |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
new_item = cmdq_get_command(cmdlist, NULL, &item->mouse, 0); |
new_item = cmdq_get_command(cmdlist, NULL, &shared->mouse, 0); |
cmdq_insert_after(item, new_item); |
cmdq_insert_after(item, new_item); |
cmd_list_free(cmdlist); |
cmd_list_free(cmdlist); |
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
|
|
cdata->item = item; |
cdata->item = item; |
else |
else |
cdata->item = NULL; |
cdata->item = NULL; |
memcpy(&cdata->mouse, &item->mouse, sizeof cdata->mouse); |
memcpy(&cdata->mouse, &shared->mouse, sizeof cdata->mouse); |
|
|
job_run(shellcmd, s, cwd, NULL, cmd_if_shell_callback, |
job_run(shellcmd, s, cwd, NULL, cmd_if_shell_callback, |
cmd_if_shell_free, cdata); |
cmd_if_shell_free, cdata); |