~ubuntu-branches/ubuntu/maverick/libxml2/maverick

« back to all changes in this revision

Viewing changes to xmlregexp.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-06-23 21:19:36 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080623211936-houumen8pccvs06t
Tags: 2.6.32.dfsg-2ubuntu1
* Merge with Debian; remaining changes:
  - debian/rules: create a udeb for debian-installer, correct libxml2-dev
    Depends to include zlib1g-dev.
  - Build a python-libxml2-dbg package.
  - Link using -Bsymbolic-functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1532
1532
static int
1533
1533
xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from,
1534
1534
                         xmlRegStatePtr to, xmlRegAtomPtr atom) {
 
1535
    xmlRegStatePtr end;
 
1536
 
1535
1537
    if (atom == NULL) {
1536
1538
        ERROR("genrate transition: atom == NULL");
1537
1539
        return(-1);
1689
1691
        else {
1690
1692
            return(-1);
1691
1693
        }
 
1694
    } 
 
1695
    end = to;
 
1696
    if ((atom->quant == XML_REGEXP_QUANT_MULT) || 
 
1697
        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
 
1698
        /*
 
1699
         * Do not pollute the target state by adding transitions from
 
1700
         * it as it is likely to be the shared target of multiple branches.
 
1701
         * So isolate with an epsilon transition.
 
1702
         */
 
1703
        xmlRegStatePtr tmp;
 
1704
        
 
1705
        tmp = xmlRegNewState(ctxt);
 
1706
        if (tmp != NULL)
 
1707
            xmlRegStatePush(ctxt, tmp);
 
1708
        else {
 
1709
            return(-1);
 
1710
        }
 
1711
        xmlFAGenerateEpsilonTransition(ctxt, tmp, to);
 
1712
        to = tmp;
1692
1713
    }
1693
1714
    if (xmlRegAtomPush(ctxt, atom) < 0) {
1694
1715
        return(-1);
1695
1716
    }
1696
1717
    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
1697
 
    ctxt->state = to;
 
1718
    ctxt->state = end;
1698
1719
    switch (atom->quant) {
1699
1720
        case XML_REGEXP_QUANT_OPT:
1700
1721
            atom->quant = XML_REGEXP_QUANT_ONCE;
5052
5073
static void
5053
5074
xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) {
5054
5075
    do {
5055
 
        if ((CUR == '\\') || (CUR == '.')) {
 
5076
        if (CUR == '\\') {
5056
5077
            xmlFAParseCharClassEsc(ctxt);
5057
5078
        } else {
5058
5079
            xmlFAParseCharRange(ctxt);