]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Previous mailbox create -s fix broke -A/-u parameters.
authorTimo Sirainen <tss@iki.fi>
Fri, 11 Feb 2011 21:35:52 +0000 (23:35 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 11 Feb 2011 21:35:52 +0000 (23:35 +0200)
Fixed now properly the root cause: -S parameter was handled as -s by getopt.

src/doveadm/doveadm-mail.c

index ca29124c4ec70e6498ed1ed4eeae884da917dd89..8988c365d27ac0873b4b24b03fe8869835a8c056 100644 (file)
@@ -372,7 +372,7 @@ doveadm_mail_cmd(const struct doveadm_mail_cmd *cmd, int argc, char *argv[])
 
        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_cmd(const struct doveadm_mail_cmd *cmd, int argc, char *argv[])
                                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]);