Skip to content

Commit

Permalink
data: fix merge operation
Browse files Browse the repository at this point in the history
lyd_merge_* functions may modify the passed dnode pointer. Make sure to
update the self.cdata pointer after the operation.

Fixes: #49
Signed-off-by: Bill Stephens <[email protected]>
  • Loading branch information
Bill Stephens authored and rjarry committed Sep 19, 2023
1 parent ef885cc commit bff1462
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libyang/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ def merge(
if ret != lib.LY_SUCCESS:
raise self.context.error("merge failed")

self.cdata = node_p[0]

def iter_tree(self) -> Iterator["DNode"]:
n = next_n = self.cdata
while n != ffi.NULL:
Expand Down

0 comments on commit bff1462

Please sign in to comment.