Mercurial > hg > th-libs
changeset 520:8b36f2566cf9
Fix item key search .. managed to break that previously.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Dec 2019 13:17:32 +0200 |
parents | e1b15fb56ddf |
children | 77495c646208 |
files | th_config.c |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/th_config.c Thu Dec 26 13:07:09 2019 +0200 +++ b/th_config.c Thu Dec 26 13:17:32 2019 +0200 @@ -276,6 +276,7 @@ { th_llist_append(item->v.list, tmp); th_cfg_set_next_parsemode(ctx, PM_LIST); + // Early exit as we set the parsemode here return; } @@ -451,11 +452,14 @@ BOOL found; tmpStr[strPos] = 0; - for (item = sect, found = FALSE; - item != NULL && !found; - item = (th_cfgitem_t *) item->node.next) + for (item = sect, found = FALSE; item != NULL && !found; ) { - found = item->name != NULL && strcmp(item->name, tmpStr) == 0; + if (item->type != ITEM_COMMENT && + item->name != NULL && + strcmp(item->name, tmpStr) == 0) + found = TRUE; + else + item = (th_cfgitem_t *) item->node.next; } // Check if key was found