| 549 | } |
| 550 | |
| 551 | staticfn boolean |
| 552 | handle_config_section(char *buf) |
| 553 | { |
| 554 | char *sect = is_config_section(buf); |
| 555 | |
| 556 | if (sect) { |
| 557 | if (gc.config_section_current) |
| 558 | free(gc.config_section_current), gc.config_section_current = 0; |
| 559 | /* is_config_section() removed brackets from 'sect' */ |
| 560 | if (!gc.config_section_chosen) { |
| 561 | config_error_add("Section \"[%s]\" without CHOOSE", sect); |
| 562 | return TRUE; |
| 563 | } |
| 564 | if (*sect) { /* got a section name */ |
| 565 | gc.config_section_current = dupstr(sect); |
| 566 | debugpline1("set config section: '%s'", |
| 567 | gc.config_section_current); |
| 568 | } else { /* empty section name => end of sections */ |
| 569 | free_config_sections(); |
| 570 | debugpline0("unset config section"); |
| 571 | } |
| 572 | return TRUE; |
| 573 | } |
| 574 | |
| 575 | if (gc.config_section_current) { |
| 576 | if (!gc.config_section_chosen) |
| 577 | return TRUE; |
| 578 | if (strcmp(gc.config_section_current, gc.config_section_chosen)) |
| 579 | return TRUE; |
| 580 | } |
| 581 | return FALSE; |
| 582 | } |
| 583 | |
| 584 | #define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE) |
| 585 |
no test coverage detected