From 5270b781e7fab9079f3bad4a960a623f12257150 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 26 Apr 2017 11:21:52 +0200 Subject: [PATCH] Fix #7355 - json indent with color glitch --- libr/include/r_th.h | 1 - libr/util/json_indent.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libr/include/r_th.h b/libr/include/r_th.h index 1755f89c86..8a30c9fa1c 100644 --- a/libr/include/r_th.h +++ b/libr/include/r_th.h @@ -13,7 +13,6 @@ //HANDLE #elif HAVE_PTHREAD -#define __USE_UNIX98 #define __GNU #include #define R_TH_TID pthread_t diff --git a/libr/util/json_indent.c b/libr/util/json_indent.c index 5ecb042547..ac4807019c 100644 --- a/libr/util/json_indent.c +++ b/libr/util/json_indent.c @@ -123,6 +123,10 @@ R_API char* r_print_json_indent(const char* s, bool color, const char* tab) { break; case '}': case ']': + *o++ = 0x1b; + *o++ = '['; + *o++ = '0'; + *o++ = 'm'; isValue = false; *o++ = '\n'; indent--; @@ -137,4 +141,3 @@ R_API char* r_print_json_indent(const char* s, bool color, const char* tab) { *o = 0; return O; } -