Mercurial > dovecot > original-hg > dovecot-2.1
changeset 14953:850b5d8bbcc9
doveadm batch: Fixed handling subcommand parameters and errors.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 05 Apr 2013 14:05:54 +0300 |
parents | c6b4a639cae1 |
children | 8e9f1c744516 |
files | src/doveadm/doveadm-mail-batch.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail-batch.c Fri Apr 05 13:21:40 2013 +0300 +++ b/src/doveadm/doveadm-mail-batch.c Fri Apr 05 14:05:54 2013 +0300 @@ -37,10 +37,14 @@ int ret = 0; array_foreach(&ctx->commands, cmdp) { + (*cmdp)->cur_mail_user = user; if ((*cmdp)->v.run(*cmdp, user) < 0) { + i_assert((*cmdp)->exit_code != 0); + _ctx->exit_code = (*cmdp)->exit_code; ret = -1; break; } + (*cmdp)->cur_mail_user = NULL; } return ret; } @@ -149,6 +153,7 @@ struct batch_cmd_context *ctx; ctx = doveadm_mail_cmd_alloc(struct batch_cmd_context); + ctx->ctx.getopt_args = "+"; /* disable processing -args in the middle */ ctx->ctx.v.preinit = cmd_batch_preinit; ctx->ctx.v.init = cmd_batch_init; ctx->ctx.v.prerun = cmd_batch_prerun;