summaryrefslogtreecommitdiffstats
path: root/cmd-if-shell.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-21 14:01:19 +0000
committernicm <nicm>2017-04-21 14:01:19 +0000
commitbba588752f8085da13edcacd71101055bd617303 (patch)
treeb75e32cccebefb24cda475bed163f613a2994548 /cmd-if-shell.c
parent311dad8c28c8c1a842beb3dbb1757064b9d83b2e (diff)
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.c5
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);