more improvements to find a 'regmust' string (PR 9602)
svn: r10751
This commit is contained in:
parent
0f97bbcd9e
commit
f83f19ea55
|
@ -245,6 +245,7 @@ regcomp(char *expstr, rxpos exp, int explen, int pcre)
|
||||||
* strong reason, but sufficient in the absence of others.
|
* strong reason, but sufficient in the absence of others.
|
||||||
*/
|
*/
|
||||||
if (flags&SPSTART) {
|
if (flags&SPSTART) {
|
||||||
|
int prev_op = 0;
|
||||||
longest = 0;
|
longest = 0;
|
||||||
longest_is_ci = 0;
|
longest_is_ci = 0;
|
||||||
len = 0;
|
len = 0;
|
||||||
|
@ -276,13 +277,18 @@ regcomp(char *expstr, rxpos exp, int explen, int pcre)
|
||||||
longest_is_ci = 0;
|
longest_is_ci = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else if ((mop == OPENN)
|
} else if ((mop == BRANCH) && (prev_op != BRANCH)) {
|
||||||
|| (mop == SAVECONST)
|
int mnext;
|
||||||
|| ((mop >= OPEN) && (mop < CLOSE))) {
|
mnext = NEXT_OP(mscan);
|
||||||
mscan = NEXT_OP(mscan);
|
if (rOP(mnext) != BRANCH) {
|
||||||
|
/* A branch with only one choice */
|
||||||
|
mscan = OPERAND(mscan);
|
||||||
|
} else
|
||||||
|
break;
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
prev_op = rOP(scan);
|
||||||
}
|
}
|
||||||
if (longest) {
|
if (longest) {
|
||||||
r->regmust = longest;
|
r->regmust = longest;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user