Fixed XML Parser not parsing empty XML sheets 100% correctly.
This commit is contained in:
@ -40,11 +40,16 @@ void Xml::load(Xml *xml, std::string data, size_t *j) {
|
||||
doing = XML_PARSE_STATE_PARSING_COMMENT;
|
||||
i += 3;
|
||||
} else if(insideTag) {
|
||||
i -= 1;
|
||||
auto child = new Xml();
|
||||
Xml::load(child, data, &i);
|
||||
xml->children.push_back(child);
|
||||
doing = XML_PARSE_STATE_PARSING_CHILD;
|
||||
if(data[i] == '/') {
|
||||
i -= 1;
|
||||
doing = XML_PARSE_STATE_PARSING_CHILD;
|
||||
} else {
|
||||
i -= 1;
|
||||
auto child = new Xml();
|
||||
Xml::load(child, data, &i);
|
||||
xml->children.push_back(child);
|
||||
doing = XML_PARSE_STATE_PARSING_CHILD;
|
||||
}
|
||||
} else {
|
||||
doing = XML_PARSE_STATE_PARSING_TAG_NAME;
|
||||
level++;
|
||||
|
Reference in New Issue
Block a user