diff options
| author | WormHeamer | 2026-01-03 02:09:36 -0500 |
|---|---|---|
| committer | WormHeamer | 2026-01-03 02:09:36 -0500 |
| commit | 09371385225debb9fee798059515c3a665f45fa1 (patch) | |
| tree | 3b2e61c858b4c04c69a971570091b28cef65649d | |
| parent | 5d32fe1b077d9b61c90b122cb342864ce0d533ad (diff) | |
fix stupid bug in backwards regex search
| -rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |
