changeset 19870:43fc8f6a1997

doveadm: Fixed parsing field/flag/file parameters.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Fri, 26 Feb 2016 15:33:23 +0200
parents 0b4934af75a3
children 8e662e9d6c06
files src/doveadm/doveadm-mail.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail.c	Fri Feb 26 15:25:27 2016 +0200
+++ b/src/doveadm/doveadm-mail.c	Fri Feb 26 15:33:23 2016 +0200
@@ -957,9 +957,6 @@
 			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 @@
 			}
 			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)