summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-queue.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-10-21 22:06:46 +0000
committernicm <nicm@openbsd.org>2014-10-21 22:06:46 +0000
commita236dc56d42c9fca63527c72962986866b7fa061 (patch)
tree43542267c7358632bce000acb72003b7bc945009 /usr.bin/tmux/cmd-queue.c
parentRework the error message a little bit: Do not send details of the (diff)
downloadwireguard-openbsd-a236dc56d42c9fca63527c72962986866b7fa061.tar.xz
wireguard-openbsd-a236dc56d42c9fca63527c72962986866b7fa061.zip
Save next item after firing command in case it has added to the queue.
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r--usr.bin/tmux/cmd-queue.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c
index 9200f208cc3..5c331e6c678 100644
--- a/usr.bin/tmux/cmd-queue.c
+++ b/usr.bin/tmux/cmd-queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-queue.c,v 1.18 2014/10/20 23:57:13 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.19 2014/10/21 22:06:46 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -180,8 +180,6 @@ cmdq_continue(struct cmd_q *cmdq)
cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry);
do {
- next = TAILQ_NEXT(cmdq->item, qentry);
-
while (cmdq->cmd != NULL) {
cmd_print(cmdq->cmd, s, sizeof s);
log_debug("cmdq %p: %s (client %d)", cmdq, s,
@@ -213,6 +211,7 @@ cmdq_continue(struct cmd_q *cmdq)
cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry);
}
+ next = TAILQ_NEXT(cmdq->item, qentry);
TAILQ_REMOVE(&cmdq->queue, cmdq->item, qentry);
cmd_list_free(cmdq->item->cmdlist);