From: Timo Sirainen Date: Fri, 2 Feb 2024 08:18:12 +0000 (+0200) Subject: config: Move fix_relative_path() earlier X-Git-Tag: 2.4.1~1079 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e89275a91c6671f9f75cba46a61c356327f5502;p=thirdparty%2Fdovecot%2Fcore.git config: Move fix_relative_path() earlier --- 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) {