314 |
logic is that a recursion can only make sense if there is another |
logic is that a recursion can only make sense if there is another |
315 |
alternation that stops the recursing. That will provide the minimum length |
alternation that stops the recursing. That will provide the minimum length |
316 |
(when no recursion happens). A backreference within the group that it is |
(when no recursion happens). A backreference within the group that it is |
317 |
referencing behaves in the same way. */ |
referencing behaves in the same way. |
318 |
|
|
319 |
|
If PCRE_JAVASCRIPT_COMPAT is set, a backreference to an unset bracket |
320 |
|
matches an empty string (by default it causes a matching failure), so in |
321 |
|
that case we must set the minimum length to zero. */ |
322 |
|
|
323 |
case OP_REF: |
case OP_REF: |
324 |
ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1)); |
if ((options & PCRE_JAVASCRIPT_COMPAT) == 0) |
325 |
if (cs == NULL) return -2; |
{ |
326 |
do ce += GET(ce, 1); while (*ce == OP_ALT); |
ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1)); |
327 |
if (cc > cs && cc < ce) |
if (cs == NULL) return -2; |
328 |
{ |
do ce += GET(ce, 1); while (*ce == OP_ALT); |
329 |
d = 0; |
if (cc > cs && cc < ce) |
330 |
had_recurse = TRUE; |
{ |
331 |
|
d = 0; |
332 |
|
had_recurse = TRUE; |
333 |
|
} |
334 |
|
else d = find_minlength(cs, startcode, options); |
335 |
} |
} |
336 |
else d = find_minlength(cs, startcode, options); |
else d = 0; |
337 |
cc += 3; |
cc += 3; |
338 |
|
|
339 |
/* Handle repeated back references */ |
/* Handle repeated back references */ |