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>
This commit is contained in:
parent
1692cad673
commit
adfd57c5fe
|
@ -130,6 +130,7 @@ Sub *update(Sub*, int, const char*);
|
||||||
void decref(Sub*);
|
void decref(Sub*);
|
||||||
|
|
||||||
struct Subject {
|
struct Subject {
|
||||||
|
const char *begin_line;
|
||||||
const char *begin;
|
const char *begin;
|
||||||
const char *end;
|
const char *end;
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,7 +68,7 @@ recursiveloop(char *pc, const char *sp, Subject *input, const char **subp, int n
|
||||||
subp[off] = old;
|
subp[off] = old;
|
||||||
return 0;
|
return 0;
|
||||||
case Bol:
|
case Bol:
|
||||||
if(sp != input->begin)
|
if(sp != input->begin_line)
|
||||||
return 0;
|
return 0;
|
||||||
continue;
|
continue;
|
||||||
case Eol:
|
case Eol:
|
||||||
|
|
Loading…
Reference in New Issue