diff options
author | nicm <nicm> | 2017-04-21 14:01:19 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-04-21 14:01:19 +0000 |
commit | bba588752f8085da13edcacd71101055bd617303 (patch) | |
tree | b75e32cccebefb24cda475bed163f613a2994548 /cmd-if-shell.c | |
parent | 311dad8c28c8c1a842beb3dbb1757064b9d83b2e (diff) | |
download | rtmux-bba588752f8085da13edcacd71101055bd617303.tar.gz rtmux-bba588752f8085da13edcacd71101055bd617303.tar.bz2 rtmux-bba588752f8085da13edcacd71101055bd617303.zip |
Store state shared between multiple commands in the queue in a shared
structure.
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r-- | cmd-if-shell.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 0b1fe7f5..fafb8cee 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -65,6 +65,7 @@ static enum cmd_retval cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; + struct cmdq_shared *shared = item->shared; struct cmd_if_shell_data *cdata; char *shellcmd, *cmd, *cause; struct cmd_list *cmdlist; @@ -100,7 +101,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) } 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); cmd_list_free(cmdlist); return (CMD_RETURN_NORMAL); @@ -125,7 +126,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) cdata->item = item; else 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, cmd_if_shell_free, cdata); |