From 3943960874e92de9bbf9975b97265184547bf1b8 Mon Sep 17 00:00:00 2001 From: Darjan Krijan Date: Wed, 21 Nov 2018 22:34:01 +0100 Subject: [PATCH] Removed spaces after \n for arrays as well --- json_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json_object.c b/json_object.c index 19f9c83..39ac236 100644 --- a/json_object.c +++ b/json_object.c @@ -1127,7 +1127,7 @@ static int json_object_array_to_json_string(struct json_object* jso, printbuf_strappend(pb, "\n"); } had_children = 1; - if (flags & JSON_C_TO_STRING_SPACED) + if (flags & JSON_C_TO_STRING_SPACED && !(flags&JSON_C_TO_STRING_PRETTY)) printbuf_strappend(pb, " "); indent(pb, level + 1, flags); val = json_object_array_get_idx(jso, ii); @@ -1144,7 +1144,7 @@ static int json_object_array_to_json_string(struct json_object* jso, indent(pb,level,flags); } - if (flags & JSON_C_TO_STRING_SPACED) + if (flags & JSON_C_TO_STRING_SPACED && !(flags&JSON_C_TO_STRING_PRETTY)) return printbuf_strappend(pb, " ]"); return printbuf_strappend(pb, "]"); }