Skip attribute parsing, to fix errors due to comment contents.

This commit is contained in:
Glenn Maynard
2005-02-25 06:13:21 +00:00
parent b923311e00
commit a7e4836149
+29 -2
View File
@@ -281,14 +281,41 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
char* xml = (char*)pszXml;
// <
xml = strchr( xml, chXMLTagOpen );
if( xml == NULL )
return NULL;
// Close Tag
if( *(xml+1) == chXMLTagPre ) // </Close
// </
if( xml[1] == chXMLTagPre )
return xml;
/* <!-- */
if( !strncmp(xml+1, "!--", 3) )
{
xml += 4;
/* Find the close tag. */
char *pEnd = strstr( xml, "-->" );
if( pEnd == NULL )
{
if( !pi->error_occur )
{
pi->error_occur = true;
pi->error_pointer = xml;
pi->error_code = PIE_ALONE_NOT_CLOSED;
pi->error_string = "Unterminated comment";
}
return NULL;
}
// Skip -->.
xml = pEnd + 3;
return Load( xml, pi );
}
// XML Node Tag Name Open
xml++;
char* pTagEnd = strpbrk( xml, " \t\r\n/>" );