diff --git a/dunst.c b/dunst.c index 4c9dbbd..0d4da00 100644 --- a/dunst.c +++ b/dunst.c @@ -1613,7 +1613,11 @@ void parse_dunstrc(char *cmdline_config_path) char *cur_section = NULL; - for (; cur_section; cur_section = next_section(cur_section)) { + for (;;) { + cur_section = next_section(cur_section); + if (!cur_section) + break; + printf("%s\n", cur_section); if (strcmp(cur_section, "global") == 0 || strcmp(cur_section, "shortcuts") == 0 || strcmp(cur_section, "urgency_low") == 0 diff --git a/options.c b/options.c index bb95790..78b0c55 100644 --- a/options.c +++ b/options.c @@ -126,6 +126,10 @@ char *next_section(char *section) if (section_count == 0) return NULL; + if (section == NULL) { + return sections[0].name; + } + for (int i = 0; i < section_count; i++) { if (strcmp(section, sections[i].name) == 0) { if (i + 1 >= section_count)