diff --git a/libr/core/cmd_search.c b/libr/core/cmd_search.c index 388151039b1f9..ac285367d5708 100644 --- a/libr/core/cmd_search.c +++ b/libr/core/cmd_search.c @@ -791,9 +791,14 @@ static int r_core_search_rop(RCore *core, ut64 from, ut64 to, int opt, const cha //Options, like JSON, linear, ... grep_arg = strchr (grep, ' '); - if (*grep && grep_arg) { - mode = *(grep_arg - 1); + if (*grep) { + if (grep_arg) { + mode = *(grep_arg - 1); grep = grep_arg; + } else { + mode = *grep; + ++grep; + } } if (*grep==' ') // grep mode