Mercurial > dovecot > core-2.2
changeset 18618:8b452eb97422
quota-dict: It wasn't possible to use multiple quota settings.
Found by Coverity
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 09 May 2015 19:57:28 +0300 |
parents | 398d94f08407 |
children | 49f5131a502e |
files | src/plugins/quota/quota-dict.c |
diffstat | 1 files changed, 7 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-dict.c Sat May 09 19:50:14 2015 +0300 +++ b/src/plugins/quota/quota-dict.c Sat May 09 19:57:28 2015 +0300 @@ -44,25 +44,19 @@ username = t_strdup_until(args, p); args = p+1; - do { + for (;;) { /* FIXME: pretty ugly in here. the parameters should have been designed to be extensible. do it in a future version */ if (strncmp(args, "noenforcing:", 12) == 0) { _root->no_enforcing = TRUE; args += 12; - continue; - } - if (strncmp(args, "hidden:", 7) == 0) { + } else if (strncmp(args, "hidden:", 7) == 0) { _root->hidden = TRUE; args += 7; - continue; - } - if (strncmp(args, "ignoreunlimited:", 16) == 0) { + } else if (strncmp(args, "ignoreunlimited:", 16) == 0) { _root->disable_unlimited_tracking = TRUE; args += 16; - continue; - } - if (strncmp(args, "ns=", 3) == 0) { + } else if (strncmp(args, "ns=", 3) == 0) { p = strchr(args, ':'); if (p == NULL) break; @@ -70,9 +64,10 @@ _root->ns_prefix = p_strdup_until(_root->pool, args + 3, p); args = p + 1; - continue; + } else { + break; } - } while (0); + } if (*username == '\0') username = _root->quota->user->username;