if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) {
ctx->indent --;
- if (compact) {
+ if (compact || obj->len == 0) {
func->ucl_emitter_append_character ('}', 1, func->ud);
}
else {
const struct ucl_emitter_functions *func = ctx->func;
ctx->indent --;
- if (compact) {
+ if (compact || obj->len == 0) {
func->ucl_emitter_append_character (']', 1, func->ud);
}
else {
ucl_emitter_print_key (print_key, ctx, obj, compact);
- if (compact) {
+ if (compact || obj->len == 0) {
func->ucl_emitter_append_character ('[', 1, func->ud);
}
else {
cur = cur->next;
}
}
-
-
}
/**
* <ident_level + 1><object content>
*/
if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) {
- if (compact) {
+ if (compact || obj->len == 0) {
func->ucl_emitter_append_character ('{', 1, func->ud);
}
else {