Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.c #874

Closed
wants to merge 8 commits into from
23 changes: 16 additions & 7 deletions tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@ static int xbc_show_value(struct xbc_node *node, bool semicolon)
int i = 0;

eol = semicolon ? ";\n" : "\n";
xbc_array_for_each_value(node, val) {
if (strchr(val, '"'))
q = '\'';
else
q = '"';
printf("%c%s%c%s", q, val, q, xbc_node_is_array(node) ? ", " : eol);
i++;
if(xbc_node_is_value(node)){
xbc_array_for_each_value(node, val) {
if (strchr(val, '"'))
q = '\'';
else
q = '"';
printf("%c%s%c%s", q, val, q, xbc_node_is_array(node) ? ", " : eol);
i++;
}
}else{
struct xbc_node *child = xbc_node_get_child(node);
while(child){
i += xbc_show_value(child, semicolon);
child = xbc_node_get_next(child);
}

}
return i;
}
Expand Down