fix parsing of rules
This commit is contained in:
parent
eaf0bc8308
commit
3ce47a9dfa
6
dunst.c
6
dunst.c
@ -1613,7 +1613,11 @@ void parse_dunstrc(char *cmdline_config_path)
|
|||||||
|
|
||||||
|
|
||||||
char *cur_section = NULL;
|
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
|
if (strcmp(cur_section, "global") == 0
|
||||||
|| strcmp(cur_section, "shortcuts") == 0
|
|| strcmp(cur_section, "shortcuts") == 0
|
||||||
|| strcmp(cur_section, "urgency_low") == 0
|
|| strcmp(cur_section, "urgency_low") == 0
|
||||||
|
@ -126,6 +126,10 @@ char *next_section(char *section)
|
|||||||
if (section_count == 0)
|
if (section_count == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (section == NULL) {
|
||||||
|
return sections[0].name;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < section_count; i++) {
|
for (int i = 0; i < section_count; i++) {
|
||||||
if (strcmp(section, sections[i].name) == 0) {
|
if (strcmp(section, sections[i].name) == 0) {
|
||||||
if (i + 1 >= section_count)
|
if (i + 1 >= section_count)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user