From 4d0a9d5b4cbf40168a7619bfebff64f2ef3c7ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 29 Sep 2014 20:35:25 +0200 Subject: [PATCH] core: remove sort on configuration files and sections The sort was causing bugs because some options were missing while reading other options, so the order of sections is important, they must not be sorted. This is a partial revert of commit 56f099bec647ef79542e3e65e847e24d1bdcaa61. --- src/core/wee-config-file.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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;