aboutsummaryrefslogtreecommitdiff
path: root/cmd-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-list.c')
-rw-r--r--cmd-list.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/cmd-list.c b/cmd-list.c
index b8a8c115..dc102dcc 100644
--- a/cmd-list.c
+++ b/cmd-list.c
@@ -81,12 +81,24 @@ bad:
int
cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
{
+ struct client *c = ctx->curclient;
struct cmd *cmd;
- int n, retval;
+ int n, retval, guards;
+
+ guards = 0;
+ if (c != NULL && c->session != NULL)
+ guards = c->flags & CLIENT_CONTROL;
retval = 0;
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
- if ((n = cmd_exec(cmd, ctx)) == -1)
+ if (guards)
+ ctx->print(ctx, "%%begin");
+ n = cmd_exec(cmd, ctx);
+ if (guards)
+ ctx->print(ctx, "%%end");
+
+ /* Return of -1 is an error. */
+ if (n == -1)
return (-1);
/*