Skip to content

Commit b91fa67

Browse files
committed
tree data BUGFIX schema mount merge
1 parent 13925ae commit b91fa67

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/tree_data.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,6 @@ lyd_insert_node_find_anchor(struct lyd_node *first_sibling, struct lyd_node *nod
688688
{
689689
struct lyd_node *anchor;
690690

691-
if (first_sibling && (first_sibling->flags & LYD_EXT)) {
692-
return NULL;
693-
}
694-
695691
/* find the anchor, so we can insert somewhere before it */
696692
anchor = lyd_insert_get_next_anchor(first_sibling, node);
697693
/* cannot insert data node after opaque nodes */
@@ -767,7 +763,8 @@ lyd_insert_node(struct lyd_node *parent, struct lyd_node **first_sibling_p, stru
767763
}
768764
first_sibling = parent ? lyd_child(parent) : *first_sibling_p;
769765

770-
if ((order == LYD_INSERT_NODE_LAST) || !node->schema || (first_sibling && (first_sibling->flags & LYD_EXT))) {
766+
if ((order == LYD_INSERT_NODE_LAST) || !node->schema ||
767+
((node->flags & LYD_EXT) && (!first_sibling || !(first_sibling->prev->flags & LYD_EXT)))) {
771768
lyd_insert_node_last(parent, &first_sibling, node);
772769
} else if (order == LYD_INSERT_NODE_LAST_BY_SCHEMA) {
773770
lyd_insert_node_ordby_schema(parent, &first_sibling, node);

0 commit comments

Comments
 (0)