Skip to content

Instantly share code, notes, and snippets.

@ThomasAdam
Created December 16, 2015 14:15
Show Gist options
  • Save ThomasAdam/c850bccca5189fa2c4db to your computer and use it in GitHub Desktop.
Save ThomasAdam/c850bccca5189fa2c4db to your computer and use it in GitHub Desktop.
diff --git a/cmd-queue.c b/cmd-queue.c
index be648d4..52e7245 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -185,13 +185,14 @@ cmdq_append(struct cmd_q *cmdq, struct cmd_list *cmdlist, struct mouse_event *m)
static enum cmd_retval
cmdq_continue_one(struct cmd_q *cmdq)
{
- struct cmd *cmd = cmdq->cmd;
- const char *name = cmd->entry->name;
- struct session *s;
- struct hooks *hooks;
- enum cmd_retval retval;
- char *tmp;
- int flags = !!(cmd->flags & CMD_CONTROL);
+ struct cmd *cmd = cmdq->cmd;
+ const char *name = cmd->entry->name;
+ struct session *s;
+ struct hooks *hooks;
+ struct cmd_find_state fs;
+ enum cmd_retval retval;
+ char *tmp;
+ int flags = !!(cmd->flags & CMD_CONTROL);
tmp = cmd_print(cmd);
log_debug("cmdq %p: %s", cmdq, tmp);
@@ -221,7 +222,7 @@ cmdq_continue_one(struct cmd_q *cmdq)
if (~cmdq->flags & CMD_Q_REENTRY) {
cmdq->flags |= CMD_Q_REENTRY;
- if (hooks_wait(hooks, cmdq, "before-%s", name) == 0)
+ if (hooks_wait(hooks, cmdq, &fs, "before-%s", name) == 0)
return (CMD_RETURN_WAIT);
if (cmd_prepare_state(cmd, cmdq, cmdq->parent) != 0)
goto error;
@@ -234,7 +235,7 @@ cmdq_continue_one(struct cmd_q *cmdq)
if (retval == CMD_RETURN_ERROR)
goto error;
- if (hooks != NULL && hooks_wait(hooks, cmdq, "after-%s", name) == 0)
+ if (hooks != NULL && hooks_wait(hooks, cmdq, &fs, "after-%s", name) == 0)
retval = CMD_RETURN_WAIT;
cmdq_guard(cmdq, "end", flags);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment