tree data BUGFIX in lyd_insert_sibling()
The lyd_insert_node() expecting first sibling.
diff --git a/src/tree_data.c b/src/tree_data.c
index 0c56c00..0e98232 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -830,10 +830,7 @@
LY_CHECK_RET(lyd_insert_check_schema(NULL, sibling->schema, node->schema));
}
- if (sibling == node) {
- /* we need to keep the connection to siblings so we can insert into them */
- sibling = sibling->prev;
- }
+ sibling = lyd_first_sibling(sibling);
if (node->parent || node->prev->next) {
lyd_unlink(node);