diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-09-29 20:35:25 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-09-29 20:35:25 +0200 |
commit | 4d0a9d5b4cbf40168a7619bfebff64f2ef3c7ce6 (patch) | |
tree | a6eab7b79f2e7a28c2feabfa025ec93759b20cef | |
parent | cff9d718e7725e398e0031971cb2e71b06c9b7e5 (diff) | |
download | weechat-4d0a9d5b4cbf40168a7619bfebff64f2ef3c7ce6.zip |
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.
-rw-r--r-- | src/core/wee-config-file.c | 16 |
1 files 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; |