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>
pull/8403/head
Damien George 2022-03-10 11:49:01 +11:00
rodzic 1692cad673
commit adfd57c5fe
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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;
};

Wyświetl plik

@ -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: