Make jq --raw-output --unbuffered work

--unbuffered was only affecting the normal output case, not the --raw-output case. Make the two of them play together.

This also makes sure that the output is flushed *after* printing the newline, so a consumer doesn't lag a line behind.
This commit is contained in:
Andrew Rodland committed 2014-02-26 01:42:29 -06:00
1 parent 15faf9dc3b
commit 36e495da1e
3 files changed
+3 -5

No files matched your search

-3
View File
@@ -265,9 +265,6 @@ void jv_dumpf(jv x, FILE *f, int flags) {
jvp_dtoa_context_init(&C);
jv_dump_term(&C, x, flags, 0, f, 0);
jvp_dtoa_context_free(&C);
if (flags & JV_PRINT_UNBUFFERED) {
fflush(f);
}
}
void jv_dump(jv x, int flags) {