Fix for cli expansion of two variables
This commit is contained in:
parent
6c7554de25
commit
99abac76a7
1 changed files with 4 additions and 4 deletions
|
|
@ -889,7 +889,7 @@ api_path_fmt2api_path(char *api_path_fmt,
|
||||||
char *strenc=NULL;
|
char *strenc=NULL;
|
||||||
cg_var *cv;
|
cg_var *cv;
|
||||||
|
|
||||||
#if 1
|
#if 0 /* XXX Does not work in expansion case */
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
j = 0; /* Count % */
|
j = 0; /* Count % */
|
||||||
for (i=0; i<strlen(api_path_fmt); i++)
|
for (i=0; i<strlen(api_path_fmt); i++)
|
||||||
|
|
@ -981,7 +981,7 @@ api_path_fmt2xpath(char *api_path_fmt,
|
||||||
cg_var *cv;
|
cg_var *cv;
|
||||||
|
|
||||||
/* Sanity check: count '%' */
|
/* Sanity check: count '%' */
|
||||||
#if 1
|
#if 0 /* XXX Does not work in expansion case */
|
||||||
j = 0; /* Count % */
|
j = 0; /* Count % */
|
||||||
for (i=0; i<strlen(api_path_fmt); i++)
|
for (i=0; i<strlen(api_path_fmt); i++)
|
||||||
if (api_path_fmt[i] == '%')
|
if (api_path_fmt[i] == '%')
|
||||||
|
|
@ -1571,14 +1571,14 @@ api_path2xml_vec(char **vec,
|
||||||
valvec = NULL;
|
valvec = NULL;
|
||||||
}
|
}
|
||||||
if (restval==NULL){
|
if (restval==NULL){
|
||||||
// XXX patch to allow for lists without restval tobe backward compat
|
// XXX patch to allow for lists without restval to be backward compat
|
||||||
// clicon_err(OE_XML, 0, "malformed key, expected '=<restval>'");
|
// clicon_err(OE_XML, 0, "malformed key, expected '=<restval>'");
|
||||||
// goto done;
|
// goto done;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if ((valvec = clicon_strsep(restval, ",", &nvalvec)) == NULL)
|
if ((valvec = clicon_strsep(restval, ",", &nvalvec)) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (cvec_len(cvk) != nvalvec){
|
if (nvalvec > cvec_len(cvk)){
|
||||||
clicon_err(OE_XML, errno, "List %s key length mismatch", name);
|
clicon_err(OE_XML, errno, "List %s key length mismatch", name);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue