Browse Source

remove pretty spaces when using pretty tabs

pull/443/head
Qais Patankar GitHub 7 years ago
parent
commit
40ea3ec009
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      json_object.c

+ 4
- 4
json_object.c View File

@@ -395,7 +395,7 @@ static int json_object_object_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 | JSON_C_TO_STRING_PRETTY)) == JSON_C_TO_STRING_SPACED)
printbuf_strappend(pb, " ");
indent(pb, level+1, flags);
printbuf_strappend(pb, "\"");
@@ -416,7 +416,7 @@ static int json_object_object_to_json_string(struct json_object* jso,
printbuf_strappend(pb, "\n");
indent(pb,level,flags);
}
if (flags & JSON_C_TO_STRING_SPACED)
if ((flags & (JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY)) == JSON_C_TO_STRING_SPACED)
return printbuf_strappend(pb, /*{*/ " }");
else
return printbuf_strappend(pb, /*{*/ "}");
@@ -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 | JSON_C_TO_STRING_PRETTY)) == JSON_C_TO_STRING_SPACED)
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 | JSON_C_TO_STRING_PRETTY)) == JSON_C_TO_STRING_SPACED)
return printbuf_strappend(pb, " ]");
return printbuf_strappend(pb, "]");
}


Loading…
Cancel
Save