error when showing sub-part of xml db
This commit is contained in:
parent
5650f29da1
commit
c9190eee44
1 changed files with 10 additions and 1 deletions
|
|
@ -1011,7 +1011,7 @@ xmldb_get_local(clicon_handle h,
|
||||||
/* If vectors are specified then filter out everything else,
|
/* If vectors are specified then filter out everything else,
|
||||||
* otherwise return complete tree.
|
* otherwise return complete tree.
|
||||||
*/
|
*/
|
||||||
if (xvec0 && xlen0){
|
|
||||||
if (xvec != NULL)
|
if (xvec != NULL)
|
||||||
for (i=0; i<xlen; i++)
|
for (i=0; i<xlen; i++)
|
||||||
xml_flag_set(xvec[i], XML_FLAG_MARK);
|
xml_flag_set(xvec[i], XML_FLAG_MARK);
|
||||||
|
|
@ -1019,6 +1019,7 @@ xmldb_get_local(clicon_handle h,
|
||||||
goto done;
|
goto done;
|
||||||
if (xml_apply(xt, CX_ELMNT, (xml_applyfn_t*)xml_flag_reset, (void*)XML_FLAG_MARK) < 0)
|
if (xml_apply(xt, CX_ELMNT, (xml_applyfn_t*)xml_flag_reset, (void*)XML_FLAG_MARK) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
if (xvec0 && xlen0){
|
||||||
*xvec0 = xvec;
|
*xvec0 = xvec;
|
||||||
xvec = NULL;
|
xvec = NULL;
|
||||||
*xlen0 = xlen;
|
*xlen0 = xlen;
|
||||||
|
|
@ -1618,6 +1619,10 @@ xmldb_put_xkey_local(clicon_handle h,
|
||||||
i++;
|
i++;
|
||||||
switch (y->ys_keyword){
|
switch (y->ys_keyword){
|
||||||
case Y_LEAF_LIST:
|
case Y_LEAF_LIST:
|
||||||
|
if (restval==NULL){
|
||||||
|
clicon_err(OE_XML, 0, "malformed key, expected '=<restval>'");
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
cprintf(ckey, "=%s", restval);
|
cprintf(ckey, "=%s", restval);
|
||||||
break;
|
break;
|
||||||
case Y_LIST:
|
case Y_LIST:
|
||||||
|
|
@ -1629,6 +1634,10 @@ xmldb_put_xkey_local(clicon_handle h,
|
||||||
/* The value is a list of keys: <key>[ <key>]* */
|
/* The value is a list of keys: <key>[ <key>]* */
|
||||||
if ((cvk = yang_arg2cvec(ykey, " ")) == NULL)
|
if ((cvk = yang_arg2cvec(ykey, " ")) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
if (restval==NULL){
|
||||||
|
clicon_err(OE_XML, 0, "malformed key, expected '=<restval>'");
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
if ((valvec = clicon_strsplit(restval, ",", &nvalvec, __FUNCTION__)) == NULL)
|
if ((valvec = clicon_strsplit(restval, ",", &nvalvec, __FUNCTION__)) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue