Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix json emission
Baptiste Daroussin committed 12 years ago
commit 97429bcec262de9b55bf831c5e164b7138af566a
parent bd84e72
1 file changed +10 -9
modified external/libucl/src/ucl_emitter.c
@@ -168,18 +168,19 @@ ucl_elt_obj_write_json (ucl_object_t *obj, UT_string *buf, unsigned int tabs, bo
			utstring_append_len (buf, ": ", 2);
		}
		ucl_obj_write_json (cur, buf, tabs + 1, false, compact);
-
		if (ucl_hash_iter_has_next (it)) {
-
			if (compact) {
-
				utstring_append_c (buf, ',');
-
			}
-
			else {
-
				utstring_append_len (buf, ",\n", 2);
-
			}
+
		if (compact) {
+
			utstring_append_c (buf, ',');
		}
-
		else if (!compact) {
-
			utstring_append_c (buf, '\n');
+
		else {
+
			utstring_append_len (buf, ",\n", 2);
		}
	}
+
	buf->i--;
+
	if (!compact) {
+
		buf->i--;
+
		utstring_append_c(buf, '\n');
+
	}
+

	ucl_add_tabs (buf, tabs, compact);
	utstring_append_c (buf, '}');
}