| 1008 |
continue; |
continue; |
| 1009 |
} |
} |
| 1010 |
|
|
| 1011 |
/* Skip over character classes */ |
/* Skip over character classes; this logic must be similar to the way they |
| 1012 |
|
are handled for real. If the first character is '^', skip it. Also, if the |
| 1013 |
|
first few characters (either before or after ^) are \Q\E or \E we skip them |
| 1014 |
|
too. This makes for compatibility with Perl. */ |
| 1015 |
|
|
| 1016 |
if (*ptr == '[') |
if (*ptr == '[') |
| 1017 |
{ |
{ |
| 1018 |
|
BOOL negate_class = FALSE; |
| 1019 |
|
for (;;) |
| 1020 |
|
{ |
| 1021 |
|
int c = *(++ptr); |
| 1022 |
|
if (c == '\\') |
| 1023 |
|
{ |
| 1024 |
|
if (ptr[1] == 'E') ptr++; |
| 1025 |
|
else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3; |
| 1026 |
|
else break; |
| 1027 |
|
} |
| 1028 |
|
else if (!negate_class && c == '^') |
| 1029 |
|
negate_class = TRUE; |
| 1030 |
|
else break; |
| 1031 |
|
} |
| 1032 |
|
|
| 1033 |
|
/* If the next character is ']', it is a data character that must be |
| 1034 |
|
skipped. */ |
| 1035 |
|
|
| 1036 |
|
if (ptr[1] == ']') ptr++; |
| 1037 |
|
|
| 1038 |
while (*(++ptr) != ']') |
while (*(++ptr) != ']') |
| 1039 |
{ |
{ |
| 1040 |
if (*ptr == 0) return -1; |
if (*ptr == 0) return -1; |