Skip to content

Commit

Permalink
Clarify inclusivity of search.from and search.to (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazarmy authored Feb 1, 2025
1 parent 1b136ad commit b38bf49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions librz/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3765,8 +3765,8 @@ RZ_API int rz_core_config_init(RzCore *core) {
SETBPREF("search.flags", "true", "All search results are flagged, otherwise only printed");
SETBPREF("search.overlap", "false", "Look for overlapped search hits");
SETI("search.maxhits", 0, "Maximum number of hits (0: no limit)");
SETI("search.from", 0, "Search start address");
SETI("search.to", UT64_MAX, "Search end address");
SETI("search.from", 0, "Search start address (inclusive)");
SETI("search.to", UT64_MAX, "Search end address (exclusive)");
n = NODECB("search.in", "io.maps", &cb_search_in);
SETDESC(n, "Specify search boundaries");
SETOPTIONS(n, "raw", "block",
Expand All @@ -3779,7 +3779,6 @@ RZ_API int rz_core_config_init(RzCore *core) {
SETICB("search.kwidx", 0, &cb_search_kwidx, "Store last search index count");
SETPREF("search.prefix", "hit", "Prefix name in search hits label");
SETBPREF("search.show", "true", "Show search results");
SETI("search.to", -1, "Search end address");
n = NODECB("search.case_sensitive", "smart", &cb_search_case_sensitive);
SETDESC(n, "Set grep(~) as case smart/sensitive/insensitive");
SETOPTIONS(n, "smart", "sensitive", "insensitive", NULL);
Expand Down
8 changes: 8 additions & 0 deletions test/db/cmd/cmd_search
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,10 @@ EOF
EXPECT=<<EOF
0x00000100 hit0_0 41424344
EOF
EXPECT_ERR=<<EOF
Searching 4 bytes in [0x100,0x104)
hits: 1
EOF
RUN

NAME=search range hex
Expand All @@ -898,6 +902,10 @@ e search.to=0x103
/x 41424344
EOF
EXPECT=
EXPECT_ERR=<<EOF
Searching 4 bytes in [0x100,0x103)
hits: 0
EOF
RUN

NAME=search range hex @(A..B)
Expand Down

0 comments on commit b38bf49

Please sign in to comment.