From: Timo Sirainen Date: Mon, 24 Feb 2025 08:32:09 +0000 (+0200) Subject: config: Avoid duplicating version numbers when listing supported config versions X-Git-Tag: 2.4.1~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a62f52f02ab7c42b24fe04256373ff9346eddc1;p=thirdparty%2Fdovecot%2Fcore.git config: Avoid duplicating version numbers when listing supported config versions --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index a0eb430c31..a71666519c 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -2533,18 +2533,20 @@ static bool config_version_find(const char *version, const char **error_r) const char *const supported_versions[] = { #ifdef DOVECOT_PRO_EDITION "3.1.0", - DOVECOT_CONFIG_VERSION, #else "2.4.0", - DOVECOT_CONFIG_VERSION, #endif NULL }; /* FIXME: implement full version checking later */ - if (!str_array_find(supported_versions, version)) { + if (!str_array_find(supported_versions, version) && + strcmp(DOVECOT_CONFIG_VERSION, version) != 0) { *error_r = t_strdup_printf( - "Currently supported versions are: %s", - t_strarray_join(supported_versions, " ")); + "Currently supported versions are: %s%s", + t_strarray_join(supported_versions, " "), + str_array_find(supported_versions, + DOVECOT_CONFIG_VERSION) ? "" : + t_strdup_printf(" %s", DOVECOT_CONFIG_VERSION)); return FALSE; } return TRUE;