1506 |
case OP_CBRA: |
case OP_CBRA: |
1507 |
case OP_BRA: |
case OP_BRA: |
1508 |
case OP_ONCE: |
case OP_ONCE: |
1509 |
|
case OP_ONCE_NC: |
1510 |
case OP_COND: |
case OP_COND: |
1511 |
d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), utf8, atend, cd); |
d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), utf8, atend, cd); |
1512 |
if (d < 0) return d; |
if (d < 0) return d; |
2046 |
|
|
2047 |
if (c == OP_BRA || c == OP_BRAPOS || |
if (c == OP_BRA || c == OP_BRAPOS || |
2048 |
c == OP_CBRA || c == OP_CBRAPOS || |
c == OP_CBRA || c == OP_CBRAPOS || |
2049 |
c == OP_ONCE || c == OP_COND) |
c == OP_ONCE || c == OP_ONCE_NC || |
2050 |
|
c == OP_COND) |
2051 |
{ |
{ |
2052 |
BOOL empty_branch; |
BOOL empty_branch; |
2053 |
if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ |
if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ |
3144 |
int subfirstbyte; |
int subfirstbyte; |
3145 |
int terminator; |
int terminator; |
3146 |
int mclength; |
int mclength; |
3147 |
|
int tempbracount; |
3148 |
uschar mcbuffer[8]; |
uschar mcbuffer[8]; |
3149 |
|
|
3150 |
/* Get next byte in the pattern */ |
/* Get next byte in the pattern */ |
4843 |
uschar *ketcode = code - 1 - LINK_SIZE; |
uschar *ketcode = code - 1 - LINK_SIZE; |
4844 |
uschar *bracode = ketcode - GET(ketcode, 1); |
uschar *bracode = ketcode - GET(ketcode, 1); |
4845 |
|
|
4846 |
if (*bracode == OP_ONCE && possessive_quantifier) *bracode = OP_BRA; |
if ((*bracode == OP_ONCE || *bracode == OP_ONCE_NC) && |
4847 |
if (*bracode == OP_ONCE) |
possessive_quantifier) *bracode = OP_BRA; |
4848 |
|
|
4849 |
|
if (*bracode == OP_ONCE || *bracode == OP_ONCE_NC) |
4850 |
*ketcode = OP_KETRMAX + repeat_type; |
*ketcode = OP_KETRMAX + repeat_type; |
4851 |
else |
else |
4852 |
{ |
{ |
5911 |
*code = bravalue; |
*code = bravalue; |
5912 |
tempcode = code; |
tempcode = code; |
5913 |
tempreqvary = cd->req_varyopt; /* Save value before bracket */ |
tempreqvary = cd->req_varyopt; /* Save value before bracket */ |
5914 |
|
tempbracount = cd->bracount; /* Save value before bracket */ |
5915 |
length_prevgroup = 0; /* Initialize for pre-compile phase */ |
length_prevgroup = 0; /* Initialize for pre-compile phase */ |
5916 |
|
|
5917 |
if (!compile_regex( |
if (!compile_regex( |
5933 |
&length_prevgroup /* Pre-compile phase */ |
&length_prevgroup /* Pre-compile phase */ |
5934 |
)) |
)) |
5935 |
goto FAILED; |
goto FAILED; |
5936 |
|
|
5937 |
|
/* If this was an atomic group and there are no capturing groups within it, |
5938 |
|
generate OP_ONCE_NC instead of OP_ONCE. */ |
5939 |
|
|
5940 |
|
if (bravalue == OP_ONCE && cd->bracount <= tempbracount) |
5941 |
|
*code = OP_ONCE_NC; |
5942 |
|
|
5943 |
if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT) |
if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT) |
5944 |
cd->assert_depth -= 1; |
cd->assert_depth -= 1; |
6738 |
|
|
6739 |
/* Other brackets */ |
/* Other brackets */ |
6740 |
|
|
6741 |
else if (op == OP_ASSERT || op == OP_ONCE || op == OP_COND) |
else if (op == OP_ASSERT || op == OP_ONCE || op == OP_ONCE_NC || |
6742 |
|
op == OP_COND) |
6743 |
{ |
{ |
6744 |
if (!is_anchored(scode, bracket_map, backref_map)) return FALSE; |
if (!is_anchored(scode, bracket_map, backref_map)) return FALSE; |
6745 |
} |
} |
6843 |
|
|
6844 |
/* Other brackets */ |
/* Other brackets */ |
6845 |
|
|
6846 |
else if (op == OP_ASSERT || op == OP_ONCE) |
else if (op == OP_ASSERT || op == OP_ONCE || op == OP_ONCE_NC) |
6847 |
{ |
{ |
6848 |
if (!is_startline(scode, bracket_map, backref_map)) return FALSE; |
if (!is_startline(scode, bracket_map, backref_map)) return FALSE; |
6849 |
} |
} |
6913 |
case OP_SCBRAPOS: |
case OP_SCBRAPOS: |
6914 |
case OP_ASSERT: |
case OP_ASSERT: |
6915 |
case OP_ONCE: |
case OP_ONCE: |
6916 |
|
case OP_ONCE_NC: |
6917 |
case OP_COND: |
case OP_COND: |
6918 |
if ((d = find_firstassertedchar(scode, op == OP_ASSERT)) < 0) |
if ((d = find_firstassertedchar(scode, op == OP_ASSERT)) < 0) |
6919 |
return -1; |
return -1; |