dovecot-2.1: doveadm: Allow subcommands to specify '+' getopt pa...

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 27 14:38:16 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/0d502dc7d265
changeset: 14199:0d502dc7d265
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 27 14:37:45 2012 +0200
description:
doveadm: Allow subcommands to specify '+' getopt parameter.

diffstat:

 src/doveadm/doveadm-mail.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r c07415305d9e -r 0d502dc7d265 src/doveadm/doveadm-mail.c
--- a/src/doveadm/doveadm-mail.c	Mon Feb 27 13:34:20 2012 +0200
+++ b/src/doveadm/doveadm-mail.c	Mon Feb 27 14:37:45 2012 +0200
@@ -455,7 +455,10 @@
 	if (doveadm_debug)
 		ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_DEBUG;
 
-	getopt_args = t_strconcat("AS:u:", ctx->getopt_args, NULL);
+	getopt_args = "AS:u:";
+	/* keep context's getopt_args first in case it contains '+' */
+	if (ctx->getopt_args != NULL)
+		getopt_args = t_strconcat(ctx->getopt_args, getopt_args, NULL);
 	ctx->cur_username = getenv("USER");
 	wildcard_user = NULL;
 	while ((c = getopt(argc, argv, getopt_args)) > 0) {


More information about the dovecot-cvs mailing list