diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 15:55:52 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 15:55:52 +0000 |
commit | bbcd02d308c01313ff44ba41376758f81178d8ab (patch) | |
tree | c6cbb71bd44cf5c395891b8b7ae04c6fc330e498 /usr.bin/tmux/control.c | |
parent | 209c1b999f121d23cb4604659577998e9c854d0c (diff) |
When adding a list of commands to the queue, instead of automatically
creating a new state for each group of commands, require the caller to
create one and use it for all the commands in the list. This means the
current target works even with list with multiple groups (which can
happen if they are defined with newlines).
Diffstat (limited to 'usr.bin/tmux/control.c')
-rw-r--r-- | usr.bin/tmux/control.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/control.c b/usr.bin/tmux/control.c index 9848a1873a1..195b76a4154 100644 --- a/usr.bin/tmux/control.c +++ b/usr.bin/tmux/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.28 2020/04/13 14:46:04 nicm Exp $ */ +/* $OpenBSD: control.c,v 1.29 2020/04/13 15:55:51 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -60,6 +60,7 @@ control_callback(__unused struct client *c, __unused const char *path, { char *line; struct cmdq_item *item; + struct cmdq_state *state; struct cmd_parse_result *pr; if (closed || error != 0) @@ -85,9 +86,10 @@ control_callback(__unused struct client *c, __unused const char *path, cmdq_append(c, item); break; case CMD_PARSE_SUCCESS: - item = cmdq_get_command(pr->cmdlist, NULL, NULL, - CMDQ_STATE_CONTROL); + state = cmdq_new_state(NULL, NULL, CMDQ_STATE_CONTROL); + item = cmdq_get_command(pr->cmdlist, state); cmdq_append(c, item); + cmdq_free_state(state); cmd_list_free(pr->cmdlist); break; } |