diff options
author | 2013-03-25 10:05:00 +0000 | |
---|---|---|
committer | 2013-03-25 10:05:00 +0000 | |
commit | 4567b372148d46f6ecb4d5ea13e33fafe8a677e0 (patch) | |
tree | 7f5da7efdf6b44d8ca871d0a1acab90edfc2f38e /usr.bin/tmux/cmd-queue.c | |
parent | tty.path can be NULL, don't dereference it. From George Nachman. (diff) | |
download | wireguard-openbsd-4567b372148d46f6ecb4d5ea13e33fafe8a677e0.tar.xz wireguard-openbsd-4567b372148d46f6ecb4d5ea13e33fafe8a677e0.zip |
Print %%error not %%end guard on error, from George Nachman.
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r-- | usr.bin/tmux/cmd-queue.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index cd3db64864f..e686b2a4b6e 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.1 2013/03/24 09:54:10 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.2 2013/03/25 10:05:00 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net> @@ -207,8 +207,12 @@ cmdq_continue(struct cmd_q *cmdq) if (guards) cmdq_print(cmdq, "%%begin"); retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq); - if (guards) - cmdq_print(cmdq, "%%end"); + if (guards) { + if (retval == CMD_RETURN_ERROR) + cmdq_print(cmdq, "%%error"); + else + cmdq_print(cmdq, "%%end"); + } if (retval == CMD_RETURN_ERROR) break; |