From da7c6d7313c044b60a415061f2d1787889724336 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 26 Feb 2016 15:33:23 +0200 Subject: [PATCH] doveadm: Fixed parsing field/flag/file parameters. --- src/doveadm/doveadm-mail.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/doveadm/doveadm-mail.c b/src/doveadm/doveadm-mail.c index f1066994a7..36193a0e8c 100644 --- a/src/doveadm/doveadm-mail.c +++ b/src/doveadm/doveadm-mail.c @@ -957,9 +957,6 @@ doveadm_cmd_ver2_to_mail_cmd_wrapper(const struct doveadm_cmd_ver2* cmd, wildcard_user = "*"; ctx->users_list_input = argv[i].value.v_istream; i_stream_ref(ctx->users_list_input); - } else if (ctx->v.parse_arg != NULL && argv[i].short_opt != '\0') { - optarg = (char*)argv[i].value.v_string; - ctx->v.parse_arg(ctx, argv[i].short_opt); } else if (strcmp(argv[i].name, "field") == 0 || strcmp(argv[i].name, "flag") == 0) { /* mailbox status, fetch, flags: convert an array into a @@ -979,6 +976,12 @@ doveadm_cmd_ver2_to_mail_cmd_wrapper(const struct doveadm_cmd_ver2* cmd, } ctx->cmd_input = argv[i].value.v_istream; i_stream_ref(ctx->cmd_input); + + /* Keep all named special parameters above this line */ + + } else if (ctx->v.parse_arg != NULL && argv[i].short_opt != '\0') { + optarg = (char*)argv[i].value.v_string; + ctx->v.parse_arg(ctx, argv[i].short_opt); } else if ((argv[i].flags & CMD_PARAM_FLAG_POSITIONAL) != 0) { /* feed this into pargv */ if (argv[i].type == CMD_PARAM_ARRAY) -- 2.47.3