summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2026-01-03 02:09:36 -0500
committerWormHeamer2026-01-03 02:09:36 -0500
commit09371385225debb9fee798059515c3a665f45fa1 (patch)
tree3b2e61c858b4c04c69a971570091b28cef65649d
parent5d32fe1b077d9b61c90b122cb342864ce0d533ad (diff)
fix stupid bug in backwards regex search
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 8156bb0..abc3e01 100644
--- a/main.c
+++ b/main.c
@@ -780,17 +780,17 @@ search_from_end:
TxtLoc t = l;
if (at_start(t) || txt_chr(cprev(t)) == '\n') re_search_first_chunk(&s);
while (!at_end(t)) {
- TxtLoc p = t;
Str chnk = txt_next_chunk(&t);
re_search_chunk(&s, chnk.s, chnk.n);
if (at_end(t)) re_search_last_chunk(&s);
if (re_search_match_at_start(&s, &m)) {
- *out = p;
+ *out = l;
return 1;
}
if (~s.flags & RE_SEARCH_MID_MATCH) {
if (chnk.n > 0) break;
if (txt_after(t, end)) break;
+ /* ^ how would this ever happen? */
}
}
e.scratch = a;