From 9e89275a91c6671f9f75cba46a61c356327f5502 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Feb 2024 10:18:12 +0200 Subject: [PATCH] config: Move fix_relative_path() earlier --- src/config/config-parser.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 1366af2467..0b39a1faf9 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -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) { -- 2.47.3