--- code/trunk/pcre_dfa_exec.c 2007/04/04 14:06:52 145 +++ code/trunk/pcre_dfa_exec.c 2007/04/16 15:28:08 149 @@ -2175,10 +2175,15 @@ case PCRE_NEWLINE_CR+ PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break; case PCRE_NEWLINE_ANY: newline = -1; break; + case PCRE_NEWLINE_ANYCRLF: newline = -2; break; default: return PCRE_ERROR_BADNEWLINE; } -if (newline < 0) +if (newline == -2) + { + md->nltype = NLTYPE_ANYCRLF; + } +else if (newline < 0) { md->nltype = NLTYPE_ANY; } @@ -2309,11 +2314,12 @@ while (current_subject <= end_subject && !WAS_NEWLINE(current_subject)) current_subject++; - /* If we have just passed a CR and the newline option is ANY, and we - are now at a LF, advance the match position by one more character. */ + /* If we have just passed a CR and the newline option is ANY or + ANYCRLF, and we are now at a LF, advance the match position by one more + character. */ if (current_subject[-1] == '\r' && - md->nltype == NLTYPE_ANY && + (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) && current_subject < end_subject && *current_subject == '\n') current_subject++; @@ -2425,11 +2431,14 @@ } if (current_subject > end_subject) break; - /* If we have just passed a CR and the newline option is CRLF or ANY, and we - are now at a LF, advance the match position by one more character. */ + /* If we have just passed a CR and the newline option is CRLF or ANY or + ANYCRLF, and we are now at a LF, advance the match position by one more + character. */ if (current_subject[-1] == '\r' && - (md->nltype == NLTYPE_ANY || md->nllen == 2) && + (md->nltype == NLTYPE_ANY || + md->nltype == NLTYPE_ANYCRLF || + md->nllen == 2) && current_subject < end_subject && *current_subject == '\n') current_subject++;