From 07e3947ed49cb8f9a74bbd8aa778234c3e68f635 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Wed, 17 Sep 2014 13:27:37 -0400 Subject: [PATCH] Fix bug in json pretty printer which broke formatting and possibly corrupted json --- src/io/json.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/io/json.cpp b/src/io/json.cpp index 1a8cc9d..892d0af 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -626,6 +626,11 @@ namespace fc ss<<','; } break; + case 'n': + //If we're in quotes and see a \n, just print it literally but unset the escape flag. + if( quote && escape ) + escape = false; + //No break; fall through to default case default: if( first ) { ss<<'\n';