int c = 0;
bool exists = true;
while (exists) {
- Con *out, *current;
+ Con *out, *current, *child;
c++;
exists = false;
TAILQ_FOREACH(out, &(croot->nodes_head), nodes) {
TAILQ_FOREACH(current, &(out->nodes_head), nodes) {
- if (strcasecmp(current->name, ws->name) != 0)
+ if (current->type != CT_CON)
continue;
- exists = true;
- break;
+ TAILQ_FOREACH(child, &(current->nodes_head), nodes) {
+ if (strcasecmp(child->name, ws->name) != 0)
+ continue;
+
+ exists = true;
+ break;
+ }
}
}