diff options
Diffstat (limited to 'src/common/config-parser.c')
-rw-r--r-- | src/common/config-parser.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/config-parser.c b/src/common/config-parser.c index bc4831b..f72b7fb 100644 --- a/src/common/config-parser.c +++ b/src/common/config-parser.c @@ -60,7 +60,7 @@ free_section(bc_configparser_section_t *section) bc_config_t* bc_config_parse(const char *src, size_t src_len, const char *list_sections[], - bc_error_t **err) + const char *list_sections_prefix[], bc_error_t **err) { if (err == NULL || *err != NULL) return NULL; @@ -150,6 +150,14 @@ bc_config_parse(const char *src, size_t src_len, const char *list_sections[], } } } + if (list_sections_prefix != NULL) { + for (size_t i = 0; list_sections_prefix[i] != NULL; i++) { + if (bc_str_starts_with(section_name, list_sections_prefix[i])) { + section->type = CONFIG_SECTION_TYPE_LIST; + break; + } + } + } switch (section->type) { case CONFIG_SECTION_TYPE_MAP: section->data = bc_trie_new(free); |