aboutsummaryrefslogtreecommitdiff
path: root/cmd-run-shell.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-20 22:01:46 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-20 22:01:46 +0100
commitb0da0cee4d54aa64db0f49eee509a76fd89d6f68 (patch)
tree1e54ddb0b113708c46e80d342d10be74cdf7b176 /cmd-run-shell.c
parent944fde7c57c4f3caebb04cfc3943a81ee9729de8 (diff)
parentd589be6c65c7295880bb84cd875baab2f77d5067 (diff)
downloadrtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.tar.gz
rtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.tar.bz2
rtmux-b0da0cee4d54aa64db0f49eee509a76fd89d6f68.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r--cmd-run-shell.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index 7bc1d7cc..a0115f0a 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -104,6 +104,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item)
double d;
struct timeval tv;
char *end;
+ const char *cmd = args_string(args, 0);
int wait = !args_has(args, 'b');
if ((delay = args_get(args, 'd')) != NULL) {
@@ -112,12 +113,12 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item)
cmdq_error(item, "invalid delay time: %s", delay);
return (CMD_RETURN_ERROR);
}
- } else if (args->argc == 0)
+ } else if (args_count(args) == 0)
return (CMD_RETURN_NORMAL);
cdata = xcalloc(1, sizeof *cdata);
- if (args->argc != 0)
- cdata->cmd = format_single_from_target(item, args->argv[0]);
+ if (cmd != NULL)
+ cdata->cmd = format_single_from_target(item, cmd);
cdata->shell = !args_has(args, 'C');
if (!cdata->shell) {