commit | 553d0b5939447951298b00eecbcf5d1dae9d2915 | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Fri Dec 04 16:27:52 2020 +0100 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Sat Dec 05 12:02:29 2020 +0100 |
tree | 2507a1763a17fba5b0a1709fcbd522192e9b2465 | |
parent | 71e795e66ae3ce02e0e8b4f126f2ff000f5c900b [diff] [blame] |
data tree BUGFIX handle insert sibling matching params
diff --git a/src/tree_data.c b/src/tree_data.c index 1db88a3..72f34d0 100644 --- a/src/tree_data.c +++ b/src/tree_data.c
@@ -2016,6 +2016,11 @@ LY_CHECK_RET(lyd_insert_check_schema(lysc_data_parent(sibling->schema), node->schema)); } + if (sibling == node) { + /* we need to keep the connection to siblings so we can insert into them */ + sibling = sibling->prev; + } + if (node->parent || node->prev->next) { lyd_unlink_tree(node); }