summaryrefslogtreecommitdiff
path: root/src/plugins/alias/alias-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/alias/alias-config.c')
-rw-r--r--src/plugins/alias/alias-config.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c
index f6b72f4b0..7d65a1c1b 100644
--- a/src/plugins/alias/alias-config.c
+++ b/src/plugins/alias/alias-config.c
@@ -432,35 +432,31 @@ alias_config_update_cb (const void *pointer, void *data,
int
alias_config_init ()
{
- struct t_config_section *ptr_section;
-
alias_config_file = weechat_config_new (ALIAS_CONFIG_PRIO_NAME,
&alias_config_reload, NULL, NULL);
if (!alias_config_file)
return 0;
- weechat_config_set_version (alias_config_file, ALIAS_CONFIG_VERSION,
- &alias_config_update_cb, NULL, NULL);
+ if (!weechat_config_set_version (alias_config_file, ALIAS_CONFIG_VERSION,
+ &alias_config_update_cb, NULL, NULL))
+ {
+ weechat_config_free (alias_config_file);
+ alias_config_file = NULL;
+ return 0;
+ }
/* cmd */
- ptr_section = weechat_config_new_section (
+ alias_config_section_cmd = weechat_config_new_section (
alias_config_file, "cmd",
1, 1,
NULL, NULL, NULL,
NULL, NULL, NULL,
&alias_config_cmd_write_default_cb, NULL, NULL,
&alias_config_cmd_create_option_cb, NULL, NULL,
- NULL, NULL, NULL);
- if (!ptr_section)
- {
- weechat_config_free (alias_config_file);
- alias_config_file = NULL;
- return 0;
- }
- alias_config_section_cmd = ptr_section;
+ NULL, NULL, NULL);
/* completion */
- ptr_section = weechat_config_new_section (
+ alias_config_section_completion = weechat_config_new_section (
alias_config_file, "completion",
1, 1,
NULL, NULL, NULL,
@@ -468,13 +464,6 @@ alias_config_init ()
&alias_config_completion_write_default_cb, NULL, NULL,
&alias_config_completion_create_option_cb, NULL, NULL,
NULL, NULL, NULL);
- if (!ptr_section)
- {
- weechat_config_free (alias_config_file);
- alias_config_file = NULL;
- return 0;
- }
- alias_config_section_completion = ptr_section;
return 1;
}