From adfd57c5fedec4e64c2e34cbea89aa6ecdb40a50 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 10 Mar 2022 11:49:01 +1100 Subject: [PATCH] lib/re1.5: Distinguish between subject start-of-line and start-of-srch. Otherwise a repeated sub/split will continue to match ^ to the start of that search. Signed-off-by: Damien George --- lib/re1.5/re1.5.h | 1 + lib/re1.5/recursiveloop.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/re1.5/re1.5.h b/lib/re1.5/re1.5.h index ba6f97b743..81f43ed7f5 100644 --- a/lib/re1.5/re1.5.h +++ b/lib/re1.5/re1.5.h @@ -130,6 +130,7 @@ Sub *update(Sub*, int, const char*); void decref(Sub*); struct Subject { + const char *begin_line; const char *begin; const char *end; }; diff --git a/lib/re1.5/recursiveloop.c b/lib/re1.5/recursiveloop.c index f8cb926292..17ecea3378 100644 --- a/lib/re1.5/recursiveloop.c +++ b/lib/re1.5/recursiveloop.c @@ -68,7 +68,7 @@ recursiveloop(char *pc, const char *sp, Subject *input, const char **subp, int n subp[off] = old; return 0; case Bol: - if(sp != input->begin) + if(sp != input->begin_line) return 0; continue; case Eol: