1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

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
This commit is contained in:
Daniel C. Sobral 2000-07-09 17:36:53 +00:00
parent f700468d0a
commit b6c1a56180
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62854

View File

@ -236,7 +236,7 @@ int eflags;
/* Adjust start according to moffset, to speed things up */
if (g->moffset > -1)
start = dp - g->moffset;
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
/* this loop does only one repetition except for backrefs */
for (;;) {