Skip to content

Commit

Permalink
Fix inconsistency between / and /e
Browse files Browse the repository at this point in the history
  • Loading branch information
kazarmy committed Feb 3, 2025
1 parent 33d0a8e commit d8b70b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions librz/search/regexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ RZ_API int rz_search_regexp_update(RzSearch *s, ut64 from, const ut8 *buf, int l
return -1;
}

matches = rz_regex_match_all_not_grouped(compiled, (char *)buf, len, from, RZ_REGEX_DEFAULT);
matches = rz_regex_match_all_not_grouped(compiled, (char *)buf, len, 0, RZ_REGEX_DEFAULT);
void **it;
rz_pvector_foreach (matches, it) {
RzRegexMatch *m = *it;
kw->keyword_length = m->len; // For a regex search, the keyword can be of variable length
int t = rz_search_hit_new(s, kw, m->start);
int t = rz_search_hit_new(s, kw, from + m->start);
if (t == 0) {
ret = -1;
rz_pvector_free(matches);
Expand Down
10 changes: 9 additions & 1 deletion test/db/cmd/regexp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ EXPECT=<<EOF
0x004186e0 hit0_6 .emory exhaustedlib/xstrtol.c0 <.
0x00418e58 hit0_7 .xstrtoumax/usr/libASCIICHARSETAL.
----
0x00400239 hit1_0 ./lib64/ld-linux-x86-.
0x00400f19 hit1_1 .alibselinux.so.1_IT.
0x00400fae hit1_2 .etfilecon_finilibacl.so.1acl_get.
0x00400feb hit1_3 .l_extended_filelibc.so.6fflushst.
0x004013c3 hit1_4 .cmptcgetpgrp__libc_start_maindir.
0x0041769a hit1_5 .system call./.libs/lt-.
0x004186e0 hit1_6 .emory exhaustedlib/xstrtol.c0 <.
0x00418e58 hit1_7 .xstrtoumax/usr/libASCIICHARSETAL.
EOF
EXPECT_ERR=<<EOF
Searching 3 bytes in [0x61d368,0x61d720)
Expand All @@ -145,7 +153,7 @@ Searching 3 bytes in [0x61bdf0,0x61c5f4)
Searching in [0x61d368,0x61d720)
hits: 0
Searching in [0x400000,0x41bc2c)
hits: 0
hits: 8
Searching in [0x61c5f4,0x61d360)
hits: 0
Searching in [0x61bdf0,0x61c5f4)
Expand Down

0 comments on commit d8b70b4

Please sign in to comment.