diff options
Diffstat (limited to 'cmd-list.c')
-rw-r--r-- | cmd-list.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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); /* |