-/* $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 <nicholas.marriott@gmail.com>
/* 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);
-/* $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 <me@tiagocunha.org>
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);
-/* $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 <me@tiagocunha.org>
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);
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);
}
-/* $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 <me@tiagocunha.org>
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);
}
-/* $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 <nicholas.marriott@gmail.com>
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 **,