diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-04-12 14:36:14 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-04-12 14:36:14 +0000 |
commit | bd39c50b17337e4e0f4f77370c0794046e7d2768 (patch) | |
tree | 6af19fd983f194e306480c5c9af1e25705bdc3a9 /pcre_exec.c | |
parent | f5fb7cc67b4338d6eadac91effd3ff4f30c33dde (diff) | |
download | pcre-bd39c50b17337e4e0f4f77370c0794046e7d2768.tar.gz |
Do not discard subpatterns with {0} quantifiers, as they may be called as
subroutines.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@335 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_exec.c')
-rw-r--r-- | pcre_exec.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/pcre_exec.c b/pcre_exec.c index 5673991..89fe6c2 100644 --- a/pcre_exec.c +++ b/pcre_exec.c @@ -1148,11 +1148,11 @@ for (;;) do ecode += GET(ecode,1); while (*ecode == OP_ALT); break; - /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating - that it may occur zero times. It may repeat infinitely, or not at all - - i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper - repeat limits are compiled as a number of copies, with the optional ones - preceded by BRAZERO or BRAMINZERO. */ + /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a bracket group, + indicating that it may occur zero times. It may repeat infinitely, or not + at all - i.e. it could be ()* or ()? or even (){0} in the pattern. Brackets + with fixed upper repeat limits are compiled as a number of copies, with the + optional ones preceded by BRAZERO or BRAMINZERO. */ case OP_BRAZERO: { @@ -1174,6 +1174,14 @@ for (;;) } break; + case OP_SKIPZERO: + { + next = ecode+1; + do next += GET(next,1); while (*next == OP_ALT); + ecode = next + 1 + LINK_SIZE; + } + break; + /* End of a group, repeated or non-repeating. */ case OP_KET: |