# HG changeset patch # User Matti Hamalainen # Date 1577359052 -7200 # Node ID 8b36f2566cf9a0fbf72851a8ae77d4c5dfc4c662 # Parent e1b15fb56ddf4bd81f721c7a6f7321ee75a25642 Fix item key search .. managed to break that previously. diff -r e1b15fb56ddf -r 8b36f2566cf9 th_config.c --- 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