--- a/src/tree.c Sun Apr 27 12:54:16 2025 +0200 +++ b/src/tree.c Sun Apr 27 12:56:05 2025 +0200 @@ -307,10 +307,10 @@ // search for the next node void *next; cx_tree_iter_search_next: - // check if there is a sibling + // check if there is a sibling, but only if we are not a (subtree-)root if (iter->exiting) { next = iter->node_next; - } else { + } else if (iter->depth > 1) { next = tree_next(iter->node); iter->node_next = next; }