diff options
author | 2016-11-11 11:37:25 +0000 | |
---|---|---|
committer | 2016-11-11 11:37:25 +0000 | |
commit | cc15baf746d66144b13d11254cd96fb2e2ab9f56 (patch) | |
tree | 0346be38cf083db741117ffb19a91088de4bf085 /usr.bin/tmux/cmd-run-shell.c | |
parent | Clean up FFS option handling somewhat; no functional change. (diff) | |
download | wireguard-openbsd-cc15baf746d66144b13d11254cd96fb2e2ab9f56.tar.xz wireguard-openbsd-cc15baf746d66144b13d11254cd96fb2e2ab9f56.zip |
Do not crash with run-shell -b and no window pane available, reported by
Sergei Dyshel.
Diffstat (limited to 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r-- | usr.bin/tmux/cmd-run-shell.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c index b32ce777888..d83f5620b92 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.41 2016/10/16 19:04:05 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.42 2016/11/11 11:37:25 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -62,7 +62,7 @@ cmd_run_shell_print(struct job *job, const char *msg) if (cdata->wp_id != -1) wp = window_pane_find_by_id(cdata->wp_id); - if (wp == NULL) { + if (cdata->item != NULL && wp == NULL) { cmdq_print(cdata->item, "%s", msg); return; } @@ -105,11 +105,6 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) else cdata->wp_id = -1; - if (args_has(args, 't') && wp != NULL) - cdata->wp_id = wp->id; - else - cdata->wp_id = -1; - if (!args_has(args, 'b')) cdata->item = item; |