diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index bb06fa59a..0a6dfaee7 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -206,7 +206,13 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name, new_config_file->sections = NULL; new_config_file->last_section = NULL; - config_file_config_insert (new_config_file); + new_config_file->prev_config = last_config_file; + new_config_file->next_config = NULL; + if (config_files) + last_config_file->next_config = new_config_file; + else + config_files = new_config_file; + last_config_file = new_config_file; } return new_config_file; @@ -351,7 +357,13 @@ config_file_new_section (struct t_config_file *config_file, const char *name, new_section->options = NULL; new_section->last_option = NULL; - config_file_section_insert_in_config (new_section); + new_section->prev_section = config_file->last_section; + new_section->next_section = NULL; + if (config_file->sections) + config_file->last_section->next_section = new_section; + else + config_file->sections = new_section; + config_file->last_section = new_section; } return new_section;