From 61e03690caf737d115d097e6688768078d617e71 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 6 Feb 2020 18:02:14 +0100 Subject: [PATCH] Fixed: Pretty-printed XML using prefixes not parsed correctly. * eg ` ` could lead to errors, wheras (` `) works fine. --- CHANGELOG.md | 5 ++++- lib/src/clixon_xml_parse.y | 15 +++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e94a58b..30851305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,14 @@ Patch release based on testing by Dave Cornejo, Netgate -### Minor changes +### API changes on existing features (you may need to change your code) * Session-id CLI functionality delayed: "lazy evaluation" + * C-api: Changed `clicon_session_id_get(clicon_handle h, uint32_t *id)` * From a cli perspective this is a revert to 4.1 behaviour, where the cli does not immediately exit on start if the backend is not running, but with the new session-id function ### Corrected Bugs +* Fixed: Pretty-printed XML using prefixes not parsed correctly. + * eg ` ` could lead to errors, wheras (` `) works fine. * XML namespace merge bug fixed. Example: two xmlns attributes could both survive a merge whereas one should replace the other. * Compile option `VALIDATE_STATE_XML` introduced in `include/custom.h` to control whether code for state data validation is compiled or not. * Fixed: Validation of user state data led to wrong validation, if state relied on config data, eg leafref/must/when etc. diff --git a/lib/src/clixon_xml_parse.y b/lib/src/clixon_xml_parse.y index 3a1e9419..0c08d811 100644 --- a/lib/src/clixon_xml_parse.y +++ b/lib/src/clixon_xml_parse.y @@ -335,10 +335,17 @@ xml_parse_bslash2(struct xml_parse_yacc_arg *ya, while ((xc = xml_child_each(x, xc, CX_ELMNT)) != NULL) break; if (xc != NULL){ /* at least one element */ - xc = NULL; - while ((xc = xml_child_each(x, xc, CX_BODY)) != NULL) { - xml_value_set(xc, ""); /* XXX remove */ - } + int i; + for (i=0; i