Fix json output for regexp in rafind2 ##search

This commit is contained in:
Tomasz Gorochowik 2021-04-16 19:31:09 +02:00 committed by pancake
parent 5f98cb2ff8
commit c6743de865

View File

@ -464,7 +464,7 @@ R_API int r_main_rafind2(int argc, const char **argv) {
if (opt.ind + 1 == argc && !r_file_is_directory (argv[opt.ind])) {
ro.quiet = true;
}
if (ro.json && ro.mode == R_SEARCH_KEYWORD) {
if (ro.json && (ro.mode == R_SEARCH_KEYWORD || ro.mode == R_SEARCH_REGEXP)) {
// TODO: remove mode check when all modes use api
ro.pj = pj_new ();
pj_a (ro.pj);