diff options
Diffstat (limited to 'pcretest.c')
-rw-r--r-- | pcretest.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -1972,7 +1972,7 @@ while (!done) for (;; gmatched++) /* Loop for /g or /G */ { - int gany_fudge; + int gany_fudge; if (timeitm > 0) { register int i; @@ -2256,17 +2256,17 @@ while (!done) what Perl's /g options does. This turns out to be rather cunning. First we set PCRE_NOTEMPTY and PCRE_ANCHORED and try the match again at the same point. If this fails (picked up above) we advance to the next - character. - + character. + Yet more complication arises in the case when the newline option is - "any" and a pattern in multiline mode has to match at the start of a - line. If a previous match was at the end of a line, and advance of one - character just passes the \r, whereas we should prefer the longer newline + "any" and a pattern in multiline mode has to match at the start of a + line. If a previous match was at the end of a line, and advance of one + character just passes the \r, whereas we should prefer the longer newline sequence, as does the code in pcre_exec(). So we fudge it. */ g_notempty = 0; - gany_fudge = 0; - + gany_fudge = 0; + if (use_offsets[0] == use_offsets[1]) { if (use_offsets[0] == len) break; @@ -2274,9 +2274,9 @@ while (!done) if ((((real_pcre *)re)->options & PCRE_STARTLINE) != 0 && (((real_pcre *)re)->options & PCRE_NEWLINE_BITS) == PCRE_NEWLINE_ANY && use_offsets[0] < len - 1 && - bptr[use_offsets[0]] == '\r' && + bptr[use_offsets[0]] == '\r' && bptr[use_offsets[0]+1] == '\n') - gany_fudge = 1; + gany_fudge = 1; } /* For /g, update the start offset, leaving the rest alone */ |