8f9e434f | 09-Jul-2000 |
Daniel C. Sobral <dcs@FreeBSD.org> |
altoffset() always returned whenever it recursed, because at the end of the processing of the recursion, "scan" would be pointing to O_CH (or O_QUEST), which would then be interpreted as being the en
altoffset() always returned whenever it recursed, because at the end of the processing of the recursion, "scan" would be pointing to O_CH (or O_QUEST), which would then be interpreted as being the end character for altoffset().
We avoid this by properly increasing scan before leaving the switch.
Without this, something like (a?b?)?cc would result in a g->moffset of 1 instead of 2.
I added a case to the soon-to-be-imported regex(3) test code to catch this error.
show more ...
|
b6c1a561 | 09-Jul-2000 |
Daniel C. Sobral <dcs@FreeBSD.org> |
Since g->moffset points to the _maximum_ offset at which the must string may be found (from the beginning of the pattern), the point at which must is found minus that offset may actually point to som
Since g->moffset points to the _maximum_ offset at which the must string may be found (from the beginning of the pattern), the point at which must is found minus that offset may actually point to some place before the start of the text.
In that case, make start = start.
Alternatively, this could be tested for in the preceding if, but it did not occur to me. :-)
Caught by: regex(3) test code
show more ...
|