Permalink
Browse files

Now also flushes when a ] character is encountered when the indent le…

…vel is 0.
  • Loading branch information...
1 parent 7ff8254 commit 10176029d40354844eeaf515f952ded8a686f6fe Ben Souther committed Jun 21, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/jsonf.c
View
@@ -49,13 +49,14 @@ void process_fp(FILE *fp) {
}
}
+
last=c;
if (instr || !(' ' == c || '\t' == c || '\r' == c || '\n' == c)){
printf("%c",c);
}
/* Should the end of the JSON document. Flush stdout */
- if(level <= 0 && c == '}'){
+ if(level <= 0 && (c == '}' || c == ']' )){
fflush(stdout);
}
}

0 comments on commit 1017602

Please sign in to comment.