summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-if-shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-if-shell.c')
-rw-r--r--usr.bin/tmux/cmd-if-shell.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c
index 8715bdac282..4af22e0dd29 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.59 2018/08/23 15:45:05 nicm Exp $ */
+/* $OpenBSD: cmd-if-shell.c,v 1.60 2018/08/27 11:03:34 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -120,8 +120,13 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
cdata->item = NULL;
memcpy(&cdata->mouse, &shared->mouse, sizeof cdata->mouse);
- job_run(shellcmd, s, server_client_get_cwd(item->client, s), NULL,
- cmd_if_shell_callback, cmd_if_shell_free, cdata, 0);
+ if (job_run(shellcmd, s, server_client_get_cwd(item->client, s), NULL,
+ cmd_if_shell_callback, cmd_if_shell_free, cdata, 0) == NULL) {
+ cmdq_error(item, "failed to run command: %s", shellcmd);
+ free(shellcmd);
+ free(cdata);
+ return (CMD_RETURN_ERROR);
+ }
free(shellcmd);
if (args_has(args, 'b'))