diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-25 10:05:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-25 10:05:01 +0000 |
commit | 351d826b6e5021930934206399a87c9051cf5f6a (patch) | |
tree | 06044be9ef98eeafd549b1589697d59ded0ffc6a /usr.bin/tmux | |
parent | 681f46e01238cf77cf549ee63fb96ef0d556b7bc (diff) |
Print %%error not %%end guard on error, from George Nachman.
Diffstat (limited to 'usr.bin/tmux')
-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; |