From 60ded12ea7a89aed2f28f7bd285761734ad49411 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Wed, 24 Jan 2024 10:20:21 +0100 Subject: [PATCH] Fixed: [show compare/diff problems with sorted-by user](https://github.com/clicon/clixon/issues/482) xml_diff() --- lib/src/clixon_xml_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index 875b6ae1..f013f68f 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -374,6 +374,7 @@ xml_diff_ordered_by_user(cxobj *x0, * perspective, ie both have the same yang spec, if they are lists, they have the * the same keys. NOT that the values are equal! * @see xml_diff API function, this one is internal and recursive + * @see xml_diff2cbuf, clixon_text_diff2cbuf for +/- diff for XML and TEXT formats * @note reordering in ordered-by user is NOT supported */ static int @@ -422,7 +423,7 @@ xml_diff1(cxobj *x0, yc0 = xml_spec(x0c); yc1 = xml_spec(x1c); /* override ordered-by user with special look-ahead checks */ - if (eq && yc0 && yc1 && yang_find(yc0, Y_ORDERED_BY, "user")){ + if (eq && yc0 && yc1 && yc0 == yc1 && yang_find(yc0, Y_ORDERED_BY, "user")){ if (xml_diff_ordered_by_user(x0, x1, x0c, x1c, yc0, x0vec, x0veclen, x1vec, x1veclen, changed_x0, changed_x1, changedlen) < 0)