* Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224)

This commit is contained in:
Olof hagsand 2021-05-20 15:16:29 +02:00
parent 9fb9024675
commit c3e26b004c
4 changed files with 7 additions and 4 deletions

View file

@ -65,6 +65,7 @@ Users may have to change how they access the system
### Corrected Bugs ### Corrected Bugs
* Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224)
* Fixed: RESTCONF Native: Failed binding of socket in network namespace caused process zombie * Fixed: RESTCONF Native: Failed binding of socket in network namespace caused process zombie
* Fixed problems with XPATH composite operations and functions in netconf get/get-config operations. * Fixed problems with XPATH composite operations and functions in netconf get/get-config operations.
* See [XPATH issues #219](https://github.com/clicon/clixon/issues/219) * See [XPATH issues #219](https://github.com/clicon/clixon/issues/219)

View file

@ -1028,7 +1028,6 @@ restconf_connection(int s,
clicon_handle h; clicon_handle h;
int readmore = 1; int readmore = 1;
restconf_conn_h *rc; restconf_conn_h *rc;
cbuf *cberr = NULL;
clicon_debug(1, "%s", __FUNCTION__); clicon_debug(1, "%s", __FUNCTION__);
if ((conn = (evhtp_connection_t*)arg) == NULL){ if ((conn = (evhtp_connection_t*)arg) == NULL){
@ -1139,8 +1138,6 @@ restconf_connection(int s,
retval = 0; retval = 0;
done: done:
clicon_debug(1, "%s retval %d", __FUNCTION__, retval); clicon_debug(1, "%s retval %d", __FUNCTION__, retval);
if (cberr)
cbuf_free(cberr);
return retval; return retval;
} }

View file

@ -441,7 +441,7 @@ xp_function_count(xp_ctx *xc,
} }
memset(xr, 0, sizeof(*xr)); memset(xr, 0, sizeof(*xr));
xr->xc_type = XT_NUMBER; xr->xc_type = XT_NUMBER;
xr->xc_number = xr0->xc_number; xr->xc_number = xr0->xc_size;
*xrp = xr; *xrp = xr;
retval = 0; retval = 0;
done: done:

View file

@ -221,6 +221,11 @@ expectpart "$($clixon_util_xpath -f $xml3 -p "/bbb/ccc/self::node()")" 0 "nodese
new "xpath nodetest: comment nyi" new "xpath nodetest: comment nyi"
expectpart "$($clixon_util_xpath -f $xml3 -l o -p "/descendant-or-self::comment()")" 255 "XPATH function \"comment\" is not implemented" expectpart "$($clixon_util_xpath -f $xml3 -l o -p "/descendant-or-self::comment()")" 255 "XPATH function \"comment\" is not implemented"
# Count
new "find bbb with 3 ccc children using count"
expectpart "$($clixon_util_xpath -f $xml3 -l o -p "(/bbb[count(ccc)=3])")" 0 "<bbb x=\"hello\"><ccc>foo</ccc><ccc>42</ccc><ccc>bar</ccc></bbb>"
# Negative # Negative
new "xpath dontexist" new "xpath dontexist"