From: Sergey Kitov Date: Fri, 19 May 2017 07:46:27 +0000 (+0300) Subject: quota root default init changed to use common param parse function X-Git-Tag: 2.3.0.rc1~1577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa089dcef71e735dcb902cb709f0b37643fd9842;p=thirdparty%2Fdovecot%2Fcore.git quota root default init changed to use common param parse function --- diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index e15df35ce8..d4ec65f3ea 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -378,29 +378,14 @@ static void quota_root_deinit(struct quota_root *root) int quota_root_default_init(struct quota_root *root, const char *args, const char **error_r) { - const char *const *tmp; - - if (args == NULL) - return 0; - - tmp = t_strsplit_spaces(args, " "); - for (; *tmp != NULL; tmp++) { - if (strcmp(*tmp, "noenforcing") == 0) - root->no_enforcing = TRUE; - else if (strcmp(*tmp, "hidden") == 0) - root->hidden = TRUE; - else if (strcmp(*tmp, "ignoreunlimited") == 0) - root->disable_unlimited_tracking = TRUE; - else - break; - } - if (*tmp != NULL) { - *error_r = t_strdup_printf( - "Unknown parameter for backend %s: %s", - root->backend.name, *tmp); - return -1; - } - return 0; + const struct quota_param_parser default_params[] = { + quota_param_hidden, + quota_param_ignoreunlimited, + quota_param_noenforcing, + quota_param_ns, + {.param_name = NULL} + }; + return quota_parse_parameters(root, &args, error_r, default_params, FALSE); } static int