Skip to content

Commit 60d094c

Browse files
authored
Merge pull request #64 from Ramdek/master
Fixed missing comma in JSON output when flushing during recursive scan
2 parents 6d5f860 + 1105222 commit 60d094c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/output_formatter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void JsonFormatter::format(std::ostream& sink, bool end_stream)
298298

299299
pNodes n = _root->get_children();
300300
for (nodes::const_iterator it = n->begin() ; it != n->end() ; ++it) { // File level
301-
_dump_node(sink, *it, 1, it != n->end() - 1); // Append a comma for all elements but the last.
301+
_dump_node(sink, *it, 1, (it != n->end() - 1) || !end_stream); // Append a comma for all elements but the last.
302302
}
303303

304304
if (end_stream) {

0 commit comments

Comments
 (0)