From 09371385225debb9fee798059515c3a665f45fa1 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sat, 3 Jan 2026 02:09:36 -0500 Subject: fix stupid bug in backwards regex search --- main.c | 4 ++-- 1 file 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; -- cgit v1.2.3