From: nicm Date: Thu, 9 Sep 2021 13:38:32 +0000 (+0000) Subject: Expand argument to run-shell again. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b5b934721ba9a4677b17c207dc955cae91d17e2;p=openbsd Expand argument to run-shell again. --- diff --git a/usr.bin/tmux/arguments.c b/usr.bin/tmux/arguments.c index 226617014f4..1b5ec3dee10 100644 --- a/usr.bin/tmux/arguments.c +++ b/usr.bin/tmux/arguments.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arguments.c,v 1.49 2021/09/02 07:11:03 nicm Exp $ */ +/* $OpenBSD: arguments.c,v 1.50 2021/09/09 13:38:32 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -651,13 +651,14 @@ args_string(struct args *args, u_int idx) /* Make a command now. */ struct cmd_list * -args_make_commands_now(struct cmd *self, struct cmdq_item *item, u_int idx) +args_make_commands_now(struct cmd *self, struct cmdq_item *item, u_int idx, + int expand) { struct args_command_state *state; char *error; struct cmd_list *cmdlist; - state = args_make_commands_prepare(self, item, idx, NULL, 0, 0); + state = args_make_commands_prepare(self, item, idx, NULL, 0, expand); cmdlist = args_make_commands(state, 0, NULL, &error); if (cmdlist == NULL) { cmdq_error(item, "%s", error); diff --git a/usr.bin/tmux/cmd-confirm-before.c b/usr.bin/tmux/cmd-confirm-before.c index 0d3c5e84dd5..6023d7f5b0c 100644 --- a/usr.bin/tmux/cmd-confirm-before.c +++ b/usr.bin/tmux/cmd-confirm-before.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-confirm-before.c,v 1.50 2021/08/25 08:51:55 nicm Exp $ */ +/* $OpenBSD: cmd-confirm-before.c,v 1.51 2021/09/09 13:38:32 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -72,7 +72,7 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item) int wait = !args_has(args, 'b'); cdata = xcalloc(1, sizeof *cdata); - cdata->cmdlist = args_make_commands_now(self, item, 0); + cdata->cmdlist = args_make_commands_now(self, item, 0, 0); if (cdata->cmdlist == NULL) return (CMD_RETURN_ERROR); diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c index 6583feba77b..caacf4659df 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.81 2021/08/25 08:51:55 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.82 2021/09/09 13:38:32 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -84,9 +84,9 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) shellcmd = format_single_from_target(item, args_string(args, 0)); if (args_has(args, 'F')) { if (*shellcmd != '0' && *shellcmd != '\0') - cmdlist = args_make_commands_now(self, item, 1); + cmdlist = args_make_commands_now(self, item, 1, 0); else if (count == 3) - cmdlist = args_make_commands_now(self, item, 2); + cmdlist = args_make_commands_now(self, item, 2, 0); else { free(shellcmd); return (CMD_RETURN_NORMAL); @@ -101,11 +101,11 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) cdata = xcalloc(1, sizeof *cdata); - cdata->cmd_if = args_make_commands_now(self, item, 1); + cdata->cmd_if = args_make_commands_now(self, item, 1, 0); if (cdata->cmd_if == NULL) return (CMD_RETURN_ERROR); if (count == 3) { - cdata->cmd_else = args_make_commands_now(self, item, 2); + cdata->cmd_else = args_make_commands_now(self, item, 2, 0); if (cdata->cmd_else == NULL) return (CMD_RETURN_ERROR); } diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c index 92c92f1c0d3..30305cc48a4 100644 --- a/usr.bin/tmux/cmd-run-shell.c +++ b/usr.bin/tmux/cmd-run-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-run-shell.c,v 1.78 2021/08/25 08:51:55 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.79 2021/09/09 13:38:32 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -132,7 +132,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) if (cmd != NULL) cdata->cmd = format_single_from_target(item, cmd); } else { - cdata->cmdlist = args_make_commands_now(self, item, 0); + cdata->cmdlist = args_make_commands_now(self, item, 0, 1); if (cdata->cmdlist == NULL) return (CMD_RETURN_ERROR); } diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index abe1c23a5e1..0902718aef1 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1139 2021/08/27 17:25:55 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1140 2021/09/09 13:38:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2234,7 +2234,7 @@ struct args_value *args_values(struct args *); struct args_value *args_value(struct args *, u_int); const char *args_string(struct args *, u_int); struct cmd_list *args_make_commands_now(struct cmd *, struct cmdq_item *, - u_int); + u_int, int); struct args_command_state *args_make_commands_prepare(struct cmd *, struct cmdq_item *, u_int, const char *, int, int); struct cmd_list *args_make_commands(struct args_command_state *, int, char **,