diff th_config.c @ 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 4913e4230e5c
children 77495c646208
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