Skip to content

Commit

Permalink
Parse grep line only if there is a digit afterward :
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil authored and radare committed Jul 16, 2018
1 parent 8f3b7f4 commit 94f753a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libr/cons/grep.c
Expand Up @@ -255,7 +255,7 @@ static void parse_grep_expression(const char *str) {

ptr2 = strchr_ns (ptr, ':'); // line number
grep->range_line = 2; // there is not :
if (ptr2 && ptr2[1] != ':' && ptr2[1]) {
if (ptr2 && ptr2[1] != ':' && ptr2[1] && (IS_DIGIT (ptr2[1]) || ptr2[1] == '-' || ptr2[1] == '.')) {
end_ptr = end_ptr ? R_MIN (end_ptr, ptr2) : ptr2;
char *p, *token = ptr2 + 1;
p = strstr (token, "..");
Expand Down

0 comments on commit 94f753a

Please sign in to comment.