| 5138 |
cd->ctypes = tables + ctypes_offset; |
cd->ctypes = tables + ctypes_offset; |
| 5139 |
|
|
| 5140 |
/* Handle different types of newline. The three bits give seven cases. The |
/* Handle different types of newline. The three bits give seven cases. The |
| 5141 |
current code allows for fixed one- or two-byte sequences, plus "any". */ |
current code allows for fixed one- or two-byte sequences, plus "any" and |
| 5142 |
|
"anycrlf". */ |
| 5143 |
|
|
| 5144 |
switch (options & (PCRE_NEWLINE_CRLF | PCRE_NEWLINE_ANY)) |
switch (options & (PCRE_NEWLINE_CRLF | PCRE_NEWLINE_ANY)) |
| 5145 |
{ |
{ |
| 5149 |
case PCRE_NEWLINE_CR+ |
case PCRE_NEWLINE_CR+ |
| 5150 |
PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break; |
PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break; |
| 5151 |
case PCRE_NEWLINE_ANY: newline = -1; break; |
case PCRE_NEWLINE_ANY: newline = -1; break; |
| 5152 |
|
case PCRE_NEWLINE_ANYCRLF: newline = -2; break; |
| 5153 |
default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN; |
default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN; |
| 5154 |
} |
} |
| 5155 |
|
|
| 5156 |
if (newline < 0) |
if (newline == -2) |
| 5157 |
|
{ |
| 5158 |
|
cd->nltype = NLTYPE_ANYCRLF; |
| 5159 |
|
} |
| 5160 |
|
else if (newline < 0) |
| 5161 |
{ |
{ |
| 5162 |
cd->nltype = NLTYPE_ANY; |
cd->nltype = NLTYPE_ANY; |
| 5163 |
} |
} |