From f682519ea95f8c2f24f16f60c884a2a484c09417 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Sat, 20 Oct 2012 13:39:54 +0200 Subject: [PATCH] make STATIC_CONFIG behave as expected again --- dunst.c | 8 ++++---- options.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dunst.c b/dunst.c index c89874f..5f36d0d 100644 --- a/dunst.c +++ b/dunst.c @@ -1369,6 +1369,7 @@ static rule_t *dunst_rules_find_or_create(const char *section) void load_options(char *cmdline_config_path) { +#ifndef STATIC_CONFIG xdgHandle xdg; FILE *config_file = NULL; @@ -1392,6 +1393,7 @@ void load_options(char *cmdline_config_path) } load_ini_file(config_file); +#endif font = option_get_string("global", "font", "-fn", font); format = option_get_string("global", "format", "-format", format); @@ -1517,9 +1519,11 @@ void load_options(char *cmdline_config_path) cur_section, "format", current_rule->format); } +#ifndef STATIC_CONFIG fclose(config_file); free_ini(); xdgWipeHandle(&xdg); +#endif } @@ -1540,12 +1544,8 @@ int main(int argc, char *argv[]) print_version(); } -#ifndef STATIC_CONFIG char *cmdline_config_path; cmdline_config_path = cmdline_get_string("-conf/-config", NULL); -#else - cmdline_config_path = NULL; -#endif load_options(cmdline_config_path); if (cmdline_get_bool("-h/-help", False) || cmdline_get_bool("--help", False)) { diff --git a/options.c b/options.c index 1325a1f..541184b 100644 --- a/options.c +++ b/options.c @@ -25,7 +25,7 @@ typedef struct _section_t { -static int section_count; +static int section_count = 0; static section_t *sections; static section_t *new_section(char *name);