]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Move fix_relative_path() earlier
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 2 Feb 2024 08:18:12 +0000 (10:18 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
src/config/config-parser.c

index 1366af246758994e7ff14c1ffa97405103dffe1f..0b39a1faf99441dd575594e15902783cc0be7874 100644 (file)
@@ -289,6 +289,21 @@ get_setting_full_path(struct config_parser_context *ctx, const char *key)
        return str_c(str);
 }
 
+static const char *
+fix_relative_path(const char *path, struct input_stack *input)
+{
+       const char *p;
+
+       if (*path == '/')
+               return path;
+
+       p = strrchr(input->path, '/');
+       if (p == NULL)
+               return path;
+
+       return t_strconcat(t_strdup_until(input->path, p+1), path, NULL);
+}
+
 static int
 settings_value_check(struct config_parser_context *ctx,
                     const struct setting_parser_info *info,
@@ -803,21 +818,6 @@ config_apply_error(struct config_parser_context *ctx, const char *key)
        return 0;
 }
 
-static const char *
-fix_relative_path(const char *path, struct input_stack *input)
-{
-       const char *p;
-
-       if (*path == '/')
-               return path;
-
-       p = strrchr(input->path, '/');
-       if (p == NULL)
-               return path;
-
-       return t_strconcat(t_strdup_until(input->path, p+1), path, NULL);
-}
-
 static struct config_module_parser *
 config_module_parsers_init(pool_t pool)
 {