summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 10:05:01 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 10:05:01 +0000
commit351d826b6e5021930934206399a87c9051cf5f6a (patch)
tree06044be9ef98eeafd549b1589697d59ded0ffc6a /usr.bin/tmux
parent681f46e01238cf77cf549ee63fb96ef0d556b7bc (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.c10
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;