summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-if-shell.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-04-21 14:01:19 +0000
committernicm <nicm@openbsd.org>2017-04-21 14:01:19 +0000
commitbebc73f12fb20d0fe5d2665112e006eb30001352 (patch)
tree0e68251b9e45ecf8ef494c4eaa0010ff9472d71c /usr.bin/tmux/cmd-if-shell.c
parentRepair AgentX support. (diff)
downloadwireguard-openbsd-bebc73f12fb20d0fe5d2665112e006eb30001352.tar.xz
wireguard-openbsd-bebc73f12fb20d0fe5d2665112e006eb30001352.zip
Store state shared between multiple commands in the queue in a shared
structure.
Diffstat (limited to 'usr.bin/tmux/cmd-if-shell.c')
-rw-r--r--usr.bin/tmux/cmd-if-shell.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c
index b5029fbdabf..eec73e572d9 100644
--- a/usr.bin/tmux/cmd-if-shell.c
+++ b/usr.bin/tmux/cmd-if-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-if-shell.c,v 1.52 2017/04/20 09:20:22 nicm Exp $ */
+/* $OpenBSD: cmd-if-shell.c,v 1.53 2017/04/21 14:01:19 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -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);