Fixed [Clixon backend generates wrong XML on empty string value #144](https://github.com/clicon/clixon/issues/144)
This commit is contained in:
parent
fab261cb53
commit
1df420255e
2 changed files with 10 additions and 4 deletions
|
|
@ -31,6 +31,10 @@
|
||||||
|
|
||||||
* Added XPATH functions `position`
|
* Added XPATH functions `position`
|
||||||
|
|
||||||
|
### Corrected Bugs
|
||||||
|
|
||||||
|
* Fixed [Clixon backend generates wrong XML on empty string value #144](https://github.com/clicon/clixon/issues/144)
|
||||||
|
|
||||||
## 4.8.0
|
## 4.8.0
|
||||||
18 October 2020
|
18 October 2020
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -565,7 +565,7 @@ xml_diff1(cxobj *x0,
|
||||||
x0c = xml_child_each(x0, x0c, CX_ELMNT);
|
x0c = xml_child_each(x0, x0c, CX_ELMNT);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Both x0c and x1c exists, check if they are equal. */
|
/* Both x0c and x1c exists, check if they are yang-equal. */
|
||||||
eq = xml_cmp(x0c, x1c, 0, 0, NULL);
|
eq = xml_cmp(x0c, x1c, 0, 0, NULL);
|
||||||
if (eq < 0){
|
if (eq < 0){
|
||||||
if (cxvec_append(x0c, x0vec, x0veclen) < 0)
|
if (cxvec_append(x0c, x0vec, x0veclen) < 0)
|
||||||
|
|
@ -586,9 +586,11 @@ xml_diff1(cxobj *x0,
|
||||||
yc = xml_spec(x0c);
|
yc = xml_spec(x0c);
|
||||||
if (yc && yang_keyword_get(yc) == Y_LEAF){
|
if (yc && yang_keyword_get(yc) == Y_LEAF){
|
||||||
/* if x0c and x1c are leafs w bodies, then they may be changed */
|
/* if x0c and x1c are leafs w bodies, then they may be changed */
|
||||||
if ((b1 = xml_body(x0c)) != NULL && /* skip empty type */
|
b1 = xml_body(x0c);
|
||||||
(b2 = xml_body(x1c)) != NULL && /* skip empty type */
|
b2 = xml_body(x1c);
|
||||||
strcmp(b1, b2) != 0){
|
if (b1 == NULL && b2 == NULL)
|
||||||
|
;
|
||||||
|
else if (b1 == NULL || b2 == NULL || strcmp(b1, b2) != 0){
|
||||||
if (cxvec_append(x0c, changed_x0, changedlen) < 0)
|
if (cxvec_append(x0c, changed_x0, changedlen) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
(*changedlen)--; /* append two vectors */
|
(*changedlen)--; /* append two vectors */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue