VirtualBox

Changeset 22210 in vbox


Ignore:
Timestamp:
Aug 12, 2009 2:00:02 PM (15 years ago)
Author:
vboxsync
Message:

IPRT/XML: do not treat all non-elements as elements (fix wrong treatment of comments)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r22173 r22210  
    474474        boost::shared_ptr<Node> pNew;
    475475
    476         if (plibNode->name)
     476        if (plibNode->type == XML_ELEMENT_NODE)
    477477            pNew = boost::shared_ptr<Node>(new ElementNode);
    478         else
     478        else if (plibNode->type == XML_TEXT_NODE)
    479479            pNew = boost::shared_ptr<Node>(new ContentNode);
    480 
    481         pNew->m->plibNode = plibNode;
    482         pNew->m->pcszName = (const char*)plibNode->name;
    483         pNew->m->pParent = this;
    484         // store
    485         m->children.push_back(pNew);
    486 
    487         // recurse for this child element to get its own children
    488         pNew->buildChildren();
     480        if (pNew)
     481        {
     482            pNew->m->plibNode = plibNode;
     483            pNew->m->pcszName = (const char*)plibNode->name;
     484            pNew->m->pParent = this;
     485            // store
     486            m->children.push_back(pNew);
     487
     488            // recurse for this child element to get its own children
     489            pNew->buildChildren();
     490        }
    489491
    490492        plibNode = plibNode->next;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette