changeset 12731:775a3a64ea74

doveadm: Previous mailbox create -s fix broke -A/-u parameters. Fixed now properly the root cause: -S parameter was handled as -s by getopt.
author Timo Sirainen <tss@iki.fi>
date Fri, 11 Feb 2011 23:35:52 +0200
parents 723a26a7d328
children 049a922c193c
files src/doveadm/doveadm-mail.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail.c	Thu Feb 10 14:58:43 2011 +0100
+++ b/src/doveadm/doveadm-mail.c	Fri Feb 11 23:35:52 2011 +0200
@@ -372,7 +372,7 @@
 
 	ctx = doveadm_mail_cmd_init(cmd);
 
-	getopt_args = t_strconcat("As:u:", ctx->getopt_args, NULL);
+	getopt_args = t_strconcat("AS:u:", ctx->getopt_args, NULL);
 	username = getenv("USER");
 	wildcard_user = NULL;
 	while ((c = getopt(argc, argv, getopt_args)) > 0) {
@@ -399,8 +399,7 @@
 				doveadm_mail_help(cmd);
 		}
 	}
-	if (optind > 0)
-		argv += optind - 1;
+	argv += optind;
 	if (argv[0] != NULL && cmd->usage_args == NULL) {
 		i_fatal("doveadm %s: Unknown parameter: %s",
 			cmd->name, argv[0]);