]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: config_parse_file() - Remove unused modules parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Jan 2023 14:13:42 +0000 (16:13 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 13:01:47 +0000 (13:01 +0000)
src/config/config-connection.c
src/config/config-parser.c
src/config/config-parser.h
src/config/doveconf.c
src/config/main.c
src/config/test-config-parser.c

index 30eeb06ac4634a53e3c301c1c08e737f01c47fea..d23884a861a550cb9f37be30cf63c07c299315d8 100644 (file)
@@ -58,7 +58,7 @@ static int config_connection_request(struct config_connection *conn,
                const char *path, *error;
 
                path = master_service_get_config_path(master_service);
-               if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) <= 0) {
+               if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) <= 0) {
                        o_stream_nsend_str(conn->output,
                                t_strconcat("-", error, "\n", NULL));
                        return 0;
index b95d86e1d764d2db3c2d282b0e51b4f9d50f4f38..e5723bae1b896cae2a00d1a36483c4bc9d88da76 100644 (file)
@@ -998,7 +998,7 @@ void config_parser_apply_line(struct config_parser_context *ctx,
 }
 
 int config_parse_file(const char *path, enum config_parse_flags flags,
-                     const char *const *modules, const char **error_r)
+                     const char **error_r)
 {
        struct input_stack root;
        struct config_parser_context ctx;
@@ -1040,7 +1040,6 @@ int config_parse_file(const char *path, enum config_parse_flags flags,
        root.path = path;
        ctx.cur_input = &root;
        ctx.expand_values = (flags & CONFIG_PARSE_FLAG_EXPAND_VALUES) != 0;
-       ctx.modules = modules;
        hash_table_create(&ctx.seen_settings, ctx.pool, 0, str_hash, strcmp);
 
        p_array_init(&ctx.all_parsers, ctx.pool, 128);
index 92ea73d1b3cbd41d7314877b38a7f23e847d1365..4df3821124334e763788232f2a604a948a6a1e8c 100644 (file)
@@ -23,7 +23,7 @@ extern struct module *modules;
 int config_parse_net(const char *value, struct ip_addr *ip_r,
                     unsigned int *bits_r, const char **error_r);
 int config_parse_file(const char *path, enum config_parse_flags flags,
-                     const char *const *modules, const char **error_r)
+                     const char **error_r)
        ATTR_NULL(3);
 
 void config_parse_load_modules(void);
index 27bc3eab176d825bb4e7f9a375a96debff2b78ab..182c4212c5aad87e8533e7092dc69ddc826964aa 100644 (file)
@@ -969,8 +969,7 @@ int main(int argc, char *argv[])
        if (expand_vars)
                flags |= CONFIG_PARSE_FLAG_EXPAND_VALUES;
        if ((ret = config_parse_file(dump_defaults ? NULL : config_path,
-                                    flags, NULL,
-                                    &error)) == 0 &&
+                                    flags, &error)) == 0 &&
            access(EXAMPLE_CONFIG_DIR, X_OK) == 0) {
                i_fatal("%s (copy example configs from "EXAMPLE_CONFIG_DIR"/)",
                        error);
index 1a5b8eb77729a837379aa8cae3feb555cd4499e3..1bef855658654fa6c5c70749f411e985e5f9e881 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
        config_parse_load_modules();
 
        path = master_service_get_config_path(master_service);
-       if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) <= 0)
+       if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) <= 0)
                i_fatal("%s", error);
 
        /* notify about our success only after successfully parsing the
index 5503d3da802c7117c72268d2addfaf09c443d190..9ed0ef41228c2e6b9360c9f8e4148b88318c5ef5 100644 (file)
@@ -117,7 +117,7 @@ static void test_config_parser(void)
        putenv("bar=test2");
        putenv("FOO$ENV:FOO=works");
 
-       test_assert(config_parse_file(TEST_CONFIG_FILE, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) == 1);
+       test_assert(config_parse_file(TEST_CONFIG_FILE, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) == 1);
        if (error != NULL)
                i_error("config_parse_file(): %s", error);
 
@@ -138,7 +138,7 @@ static void test_config_parser(void)
        test_assert_strcmp(set->protocols, "pop3 imap");
 
        /* try again unexpanded */
-       test_assert(config_parse_file(TEST_CONFIG_FILE, 0, NULL, &error) == 1);
+       test_assert(config_parse_file(TEST_CONFIG_FILE, 0, &error) == 1);
        set = settings_parser_get(config_module_parsers[0].parser);
 
        test_assert_strcmp(set->key, "value");