summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-03-10 11:49:01 +1100
committerDamien George <damien@micropython.org>2022-03-16 12:21:00 +1100
commitadfd57c5fedec4e64c2e34cbea89aa6ecdb40a50 (patch)
tree582701b8fabdeff080a0f7cf034a2c36d9b3253c /lib
parent1692cad6733b82b1cb7631ce10c1ddb54e66058e (diff)
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 <damien@micropython.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/re1.5/re1.5.h1
-rw-r--r--lib/re1.5/recursiveloop.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/re1.5/re1.5.h b/lib/re1.5/re1.5.h
index ba6f97b74..81f43ed7f 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 f8cb92629..17ecea337 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: