From 3c3d371f996b71380547a56db4412c8ca8a31469 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 16 Sep 2021 06:39:22 +0000 Subject: Fix run-shell -d with no command, GitHub issue 2885. --- cmd-run-shell.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd-run-shell.c') diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 537a5e5f..bf43d313 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -181,7 +181,13 @@ cmd_run_shell_timer(__unused int fd, __unused short events, void* arg) struct cmd_list *cmdlist; char *error; - if (cdata->state == NULL && cmd != NULL) { + if (cdata->state == NULL) { + if (cmd == NULL) { + if (cdata->item != NULL) + cmdq_continue(cdata->item); + cmd_run_shell_free(cdata); + return; + } if (job_run(cmd, 0, NULL, cdata->s, cdata->cwd, NULL, cmd_run_shell_callback, cmd_run_shell_free, cdata, cdata->flags, -1, -1) == NULL) -- cgit v1.2.3