758 |
if (clen > 0) |
if (clen > 0) |
759 |
{ |
{ |
760 |
int rqdtype, category; |
int rqdtype, category; |
761 |
category = ucp_findchar(c, &chartype, &othercase); |
category = _pcre_ucp_findchar(c, &chartype, &othercase); |
762 |
rqdtype = code[1]; |
rqdtype = code[1]; |
763 |
if (rqdtype >= 128) |
if (rqdtype >= 128) |
764 |
{ |
{ |
865 |
if (count > 0) { ADD_ACTIVE(state_offset + 3, 0); } |
if (count > 0) { ADD_ACTIVE(state_offset + 3, 0); } |
866 |
if (clen > 0) |
if (clen > 0) |
867 |
{ |
{ |
868 |
int category = ucp_findchar(c, &chartype, &othercase); |
int category = _pcre_ucp_findchar(c, &chartype, &othercase); |
869 |
int rqdtype = code[2]; |
int rqdtype = code[2]; |
870 |
if ((d == OP_PROP) == |
if ((d == OP_PROP) == |
871 |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
878 |
case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS: |
case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS: |
879 |
count = current_state->count; /* Already matched */ |
count = current_state->count; /* Already matched */ |
880 |
if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } |
if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } |
881 |
if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) |
if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) |
882 |
{ |
{ |
883 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
884 |
int ncount = 0; |
int ncount = 0; |
887 |
int nd; |
int nd; |
888 |
int ndlen = 1; |
int ndlen = 1; |
889 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
890 |
if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
891 |
ncount++; |
ncount++; |
892 |
nptr += ndlen; |
nptr += ndlen; |
893 |
} |
} |
911 |
ADD_ACTIVE(state_offset + 3, 0); |
ADD_ACTIVE(state_offset + 3, 0); |
912 |
if (clen > 0) |
if (clen > 0) |
913 |
{ |
{ |
914 |
int category = ucp_findchar(c, &chartype, &othercase); |
int category = _pcre_ucp_findchar(c, &chartype, &othercase); |
915 |
int rqdtype = code[2]; |
int rqdtype = code[2]; |
916 |
if ((d == OP_PROP) == |
if ((d == OP_PROP) == |
917 |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
932 |
QS2: |
QS2: |
933 |
|
|
934 |
ADD_ACTIVE(state_offset + 2, 0); |
ADD_ACTIVE(state_offset + 2, 0); |
935 |
if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) |
if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) |
936 |
{ |
{ |
937 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
938 |
int ncount = 0; |
int ncount = 0; |
941 |
int nd; |
int nd; |
942 |
int ndlen = 1; |
int ndlen = 1; |
943 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
944 |
if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
945 |
ncount++; |
ncount++; |
946 |
nptr += ndlen; |
nptr += ndlen; |
947 |
} |
} |
958 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
959 |
if (clen > 0) |
if (clen > 0) |
960 |
{ |
{ |
961 |
int category = ucp_findchar(c, &chartype, &othercase); |
int category = _pcre_ucp_findchar(c, &chartype, &othercase); |
962 |
int rqdtype = code[4]; |
int rqdtype = code[4]; |
963 |
if ((d == OP_PROP) == |
if ((d == OP_PROP) == |
964 |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
(rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) |
978 |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
979 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 4, 0); } |
980 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
981 |
if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) |
if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) |
982 |
{ |
{ |
983 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
984 |
int ncount = 0; |
int ncount = 0; |
987 |
int nd; |
int nd; |
988 |
int ndlen = 1; |
int ndlen = 1; |
989 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
990 |
if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; |
991 |
ncount++; |
ncount++; |
992 |
nptr += ndlen; |
nptr += ndlen; |
993 |
} |
} |
1022 |
|
|
1023 |
/* If we have Unicode property support, we can use it to test the |
/* If we have Unicode property support, we can use it to test the |
1024 |
other case of the character, if there is one. The result of |
other case of the character, if there is one. The result of |
1025 |
ucp_findchar() is < 0 if the char isn't found, and othercase is |
_pcre_ucp_findchar() is < 0 if the char isn't found, and othercase is |
1026 |
returned as zero if there isn't another case. */ |
returned as zero if there isn't another case. */ |
1027 |
|
|
1028 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1029 |
if (ucp_findchar(c, &chartype, &othercase) < 0) |
if (_pcre_ucp_findchar(c, &chartype, &othercase) < 0) |
1030 |
#endif |
#endif |
1031 |
othercase = -1; |
othercase = -1; |
1032 |
|
|
1050 |
to wait for them to pass before continuing. */ |
to wait for them to pass before continuing. */ |
1051 |
|
|
1052 |
case OP_EXTUNI: |
case OP_EXTUNI: |
1053 |
if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M) |
if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) |
1054 |
{ |
{ |
1055 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
1056 |
int ncount = 0; |
int ncount = 0; |
1058 |
{ |
{ |
1059 |
int nclen = 1; |
int nclen = 1; |
1060 |
GETCHARLEN(c, nptr, nclen); |
GETCHARLEN(c, nptr, nclen); |
1061 |
if (ucp_findchar(c, &chartype, &othercase) != ucp_M) break; |
if (_pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) break; |
1062 |
ncount++; |
ncount++; |
1063 |
nptr += nclen; |
nptr += nclen; |
1064 |
} |
} |
1096 |
if (utf8 && c >= 128) |
if (utf8 && c >= 128) |
1097 |
{ |
{ |
1098 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1099 |
if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; |
if (_pcre_ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; |
1100 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1101 |
} |
} |
1102 |
else |
else |
1123 |
if (utf8 && c >= 128) |
if (utf8 && c >= 128) |
1124 |
{ |
{ |
1125 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1126 |
if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; |
if (_pcre_ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; |
1127 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1128 |
} |
} |
1129 |
else |
else |
1150 |
if (utf8 && c >= 128) |
if (utf8 && c >= 128) |
1151 |
{ |
{ |
1152 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1153 |
if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; |
if (_pcre_ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; |
1154 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1155 |
} |
} |
1156 |
else |
else |
1181 |
if (utf8 && c >= 128) |
if (utf8 && c >= 128) |
1182 |
{ |
{ |
1183 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1184 |
if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; |
if (_pcre_ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; |
1185 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1186 |
} |
} |
1187 |
else |
else |
1424 |
/*-----------------------------------------------------------------*/ |
/*-----------------------------------------------------------------*/ |
1425 |
case OP_ONCE: |
case OP_ONCE: |
1426 |
{ |
{ |
|
const uschar *endcode; |
|
1427 |
int local_offsets[2]; |
int local_offsets[2]; |
1428 |
int local_workspace[1000]; |
int local_workspace[1000]; |
1429 |
|
|
1445 |
const uschar *end_subpattern = code; |
const uschar *end_subpattern = code; |
1446 |
int charcount = local_offsets[1] - local_offsets[0]; |
int charcount = local_offsets[1] - local_offsets[0]; |
1447 |
int next_state_offset, repeat_state_offset; |
int next_state_offset, repeat_state_offset; |
|
BOOL is_repeated; |
|
1448 |
|
|
1449 |
do { end_subpattern += GET(end_subpattern, 1); } |
do { end_subpattern += GET(end_subpattern, 1); } |
1450 |
while (*end_subpattern == OP_ALT); |
while (*end_subpattern == OP_ALT); |
1611 |
< -1 => some kind of unexpected problem |
< -1 => some kind of unexpected problem |
1612 |
*/ |
*/ |
1613 |
|
|
1614 |
EXPORT int |
PCRE_EXPORT int |
1615 |
pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, |
1616 |
const char *subject, int length, int start_offset, int options, int *offsets, |
const char *subject, int length, int start_offset, int options, int *offsets, |
1617 |
int offsetcount, int *workspace, int wscount) |
int offsetcount, int *workspace, int wscount) |