]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Assume 0.0.0 version is the latest
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Sep 2025 08:38:32 +0000 (11:38 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Tue, 14 Oct 2025 11:28:44 +0000 (11:28 +0000)
It's used for git builds.

src/config/old-set-parser.c

index e957d6d9252699f029e976ebc430b5e6ba5a652e..e78b14ca5bc726e16df3462cdfa9f009afe9a0c6 100644 (file)
@@ -7,6 +7,13 @@
 #include "config-parser-private.h"
 #include "old-set-parser.h"
 
+static bool has_config_version(const char *dovecot_config_version)
+{
+       return dovecot_config_version[0] != '\0' &&
+               /* 0.0.0 is for git builds - it's always the latest */
+               strcmp(dovecot_config_version, "0.0.0") != 0;
+}
+
 static void ATTR_FORMAT(2, 3)
 obsolete(struct config_parser_context *ctx, const char *str, ...)
 {
@@ -35,7 +42,7 @@ static void old_settings_handle_rename(struct config_parser_context *ctx,
        struct settings_history *history = settings_history_get();
        const struct setting_history_rename *rename;
 
-       if (ctx->dovecot_config_version[0] == '\0')
+       if (!has_config_version(ctx->dovecot_config_version))
                return;
 
        array_foreach(&history->renames, rename) {
@@ -79,7 +86,7 @@ bool old_settings_default(const char *dovecot_config_version,
        struct settings_history *history = settings_history_get();
        const struct setting_history_default *def;
 
-       if (dovecot_config_version[0] == '\0')
+       if (!has_config_version(dovecot_config_version))
                return FALSE;
 
        array_foreach(&history->defaults, def) {