summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-queue.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-04-21 20:34:06 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-04-21 20:34:06 +0000
commit8ad8edde2ef5380351ea1bbdd5541d443c54cd8c (patch)
tree08999c5faeb5842ffed782b6ae9aee91dccb9a40 /usr.bin/tmux/cmd-queue.c
parent2d898502a5e1d8cac7ecafb4d62942e8ff17e051 (diff)
Clear shared state if not filling it in.
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r--usr.bin/tmux/cmd-queue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c
index 2d587aba146..eb039be743c 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.51 2017/04/21 20:26:34 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.52 2017/04/21 20:34:05 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -158,6 +158,8 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
shared = xcalloc(1, sizeof *shared);
if (current != NULL)
cmd_find_copy_state(&shared->current, current);
+ else
+ cmd_find_clear_state(&shared->current, 0);
if (m != NULL)
memcpy(&shared->mouse, m, sizeof shared->mouse);
@@ -205,6 +207,7 @@ cmdq_fire_command(struct cmdq_item *item)
retval = CMD_RETURN_ERROR;
goto out;
}
+
if (item->client == NULL)
item->client = cmd_find_client(item, NULL, 1);