* Fix #16233 - ~{} works on colorized JSONs ##json * Fix issue in json_indent
This commit is contained in:
parent
5621f4030d
commit
d95befca7a
|
@ -514,9 +514,12 @@ R_API void r_cons_grepbuf() {
|
|||
Color_RESET,
|
||||
NULL
|
||||
};
|
||||
char *bb = strdup (buf);
|
||||
r_str_ansi_filter (bb, NULL, NULL, -1);
|
||||
char *out = (cons->context->grep.human)
|
||||
? r_print_json_human (buf)
|
||||
: r_print_json_indent (buf, I (context->color_mode), " ", palette);
|
||||
? r_print_json_human (bb)
|
||||
: r_print_json_indent (bb, I (context->color_mode), " ", palette);
|
||||
free (bb);
|
||||
if (!out) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -326,11 +326,13 @@ R_API char* r_print_json_indent(const char* s, bool color, const char* tab, cons
|
|||
case ':':
|
||||
*o++ = *s;
|
||||
*o++ = ' ';
|
||||
if (!strncmp (s + 1, "true", 4)) {
|
||||
s = r_str_trim_head_ro (s + 1);
|
||||
if (!strncmp (s, "true", 4)) {
|
||||
EMIT_ESC (o, colors[JC_TRUE]);
|
||||
} else if (!strncmp (s + 1, "false", 5)) {
|
||||
} else if (!strncmp (s, "false", 5)) {
|
||||
EMIT_ESC (o, colors[JC_FALSE]);
|
||||
}
|
||||
s--;
|
||||
isValue = true;
|
||||
break;
|
||||
case ',':
|
||||
|
|
Loading…
Reference in New Issue