diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 19:12:46 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 19:12:46 +0000 |
commit | 505115c27f5454df0878407c7706c7f1c3744b0d (patch) | |
tree | df43feb18444d5be3bf35ed3ee16156d49e17776 /third_party/libxml/xmlregexp.c | |
parent | e8c2172aa23158985682d232cf290593b8206b90 (diff) | |
download | chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.zip chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.gz chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.bz2 |
Updates libxml to 2.6.32. Updated google.patch and README.google
BUG=1300342
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libxml/xmlregexp.c')
-rw-r--r-- | third_party/libxml/xmlregexp.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/third_party/libxml/xmlregexp.c b/third_party/libxml/xmlregexp.c index 660c21b..2f8ae3d 100644 --- a/third_party/libxml/xmlregexp.c +++ b/third_party/libxml/xmlregexp.c @@ -1532,6 +1532,8 @@ xmlFAGenerateCountedTransition(xmlRegParserCtxtPtr ctxt, static int xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, xmlRegStatePtr to, xmlRegAtomPtr atom) { + xmlRegStatePtr end; + if (atom == NULL) { ERROR("genrate transition: atom == NULL"); return(-1); @@ -1689,12 +1691,31 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, else { return(-1); } + } + end = to; + if ((atom->quant == XML_REGEXP_QUANT_MULT) || + (atom->quant == XML_REGEXP_QUANT_PLUS)) { + /* + * Do not pollute the target state by adding transitions from + * it as it is likely to be the shared target of multiple branches. + * So isolate with an epsilon transition. + */ + xmlRegStatePtr tmp; + + tmp = xmlRegNewState(ctxt); + if (tmp != NULL) + xmlRegStatePush(ctxt, tmp); + else { + return(-1); + } + xmlFAGenerateEpsilonTransition(ctxt, tmp, to); + to = tmp; } if (xmlRegAtomPush(ctxt, atom) < 0) { return(-1); } xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1); - ctxt->state = to; + ctxt->state = end; switch (atom->quant) { case XML_REGEXP_QUANT_OPT: atom->quant = XML_REGEXP_QUANT_ONCE; @@ -5052,7 +5073,7 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { static void xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) { do { - if ((CUR == '\\') || (CUR == '.')) { + if (CUR == '\\') { xmlFAParseCharClassEsc(ctxt); } else { xmlFAParseCharRange(ctxt); |