make STATIC_CONFIG behave as expected again

This commit is contained in:
Sascha Kruse 2012-10-20 13:39:54 +02:00
parent 65d07c4f96
commit f682519ea9
2 changed files with 5 additions and 5 deletions

View File

@ -1369,6 +1369,7 @@ static rule_t *dunst_rules_find_or_create(const char *section)
void load_options(char *cmdline_config_path) void load_options(char *cmdline_config_path)
{ {
#ifndef STATIC_CONFIG
xdgHandle xdg; xdgHandle xdg;
FILE *config_file = NULL; FILE *config_file = NULL;
@ -1392,6 +1393,7 @@ void load_options(char *cmdline_config_path)
} }
load_ini_file(config_file); load_ini_file(config_file);
#endif
font = option_get_string("global", "font", "-fn", font); font = option_get_string("global", "font", "-fn", font);
format = option_get_string("global", "format", "-format", format); 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); cur_section, "format", current_rule->format);
} }
#ifndef STATIC_CONFIG
fclose(config_file); fclose(config_file);
free_ini(); free_ini();
xdgWipeHandle(&xdg); xdgWipeHandle(&xdg);
#endif
} }
@ -1540,12 +1544,8 @@ int main(int argc, char *argv[])
print_version(); print_version();
} }
#ifndef STATIC_CONFIG
char *cmdline_config_path; char *cmdline_config_path;
cmdline_config_path = cmdline_get_string("-conf/-config", NULL); cmdline_config_path = cmdline_get_string("-conf/-config", NULL);
#else
cmdline_config_path = NULL;
#endif
load_options(cmdline_config_path); load_options(cmdline_config_path);
if (cmdline_get_bool("-h/-help", False) || cmdline_get_bool("--help", False)) { if (cmdline_get_bool("-h/-help", False) || cmdline_get_bool("--help", False)) {

View File

@ -25,7 +25,7 @@ typedef struct _section_t {
static int section_count; static int section_count = 0;
static section_t *sections; static section_t *sections;
static section_t *new_section(char *name); static section_t *new_section(char *name);