cleanup
This commit is contained in:
@@ -59,7 +59,8 @@ struct RunInitEntities
|
|||||||
// skip spaces
|
// skip spaces
|
||||||
static char* tcsskip( const char* psz )
|
static char* tcsskip( const char* psz )
|
||||||
{
|
{
|
||||||
while( psz && isspace(*psz) ) psz++;
|
while( psz && isspace(*psz) )
|
||||||
|
++psz;
|
||||||
|
|
||||||
return (char*)psz;
|
return (char*)psz;
|
||||||
}
|
}
|
||||||
@@ -131,7 +132,7 @@ const char* XNode::LoadAttributes( const char* xml, PARSEINFO *pi /*= &piDefault
|
|||||||
pi->error_occur = true;
|
pi->error_occur = true;
|
||||||
pi->error_pointer = xml;
|
pi->error_pointer = xml;
|
||||||
pi->error_code = PIE_ATTR_NO_VALUE;
|
pi->error_code = PIE_ATTR_NO_VALUE;
|
||||||
pi->error_string = ssprintf( ("<%s> attribute has error "), m_sName.c_str() );
|
pi->error_string = ssprintf( "<%s> attribute has error ", m_sName.c_str() );
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -331,7 +332,7 @@ const char* XNode::Load( const char* xml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
// open/close tag <TAG ..> ... </TAG>
|
// open/close tag <TAG ..> ... </TAG>
|
||||||
// ^- current pointer
|
// ^- current pointer
|
||||||
// CloseTag case
|
// CloseTag case
|
||||||
if( xml && *xml && *(xml+1) && *xml == chXMLTagOpen && *(xml+1) == chXMLTagPre )
|
if( xml && xml[0] == chXMLTagOpen && xml[1] == chXMLTagPre )
|
||||||
{
|
{
|
||||||
// </Close>
|
// </Close>
|
||||||
xml+=2; // C
|
xml+=2; // C
|
||||||
@@ -340,7 +341,6 @@ const char* XNode::Load( const char* xml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
if( xml == NULL )
|
if( xml == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
CString closename;
|
|
||||||
const char* pEnd = strpbrk( xml, " >" );
|
const char* pEnd = strpbrk( xml, " >" );
|
||||||
if( pEnd == NULL )
|
if( pEnd == NULL )
|
||||||
{
|
{
|
||||||
@@ -354,17 +354,18 @@ const char* XNode::Load( const char* xml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
// error
|
// error
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString closename;
|
||||||
SetString( xml, pEnd, &closename );
|
SetString( xml, pEnd, &closename );
|
||||||
|
xml = pEnd+1;
|
||||||
if( closename == this->m_sName )
|
if( closename == this->m_sName )
|
||||||
{
|
{
|
||||||
// wel-formed open/close
|
// wel-formed open/close
|
||||||
xml = pEnd+1;
|
|
||||||
// return '>' or ' ' after pointer
|
// return '>' or ' ' after pointer
|
||||||
return xml;
|
return xml;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xml = pEnd+1;
|
|
||||||
// not welformed open/close
|
// not welformed open/close
|
||||||
if( !pi->error_occur )
|
if( !pi->error_occur )
|
||||||
{
|
{
|
||||||
@@ -372,7 +373,6 @@ const char* XNode::Load( const char* xml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
pi->error_pointer = xml;
|
pi->error_pointer = xml;
|
||||||
pi->error_code = PIE_NOT_NESTED;
|
pi->error_code = PIE_NOT_NESTED;
|
||||||
pi->error_string = ssprintf( "'<%s> ... </%s>' is not well-formed.", m_sName.c_str(), closename.c_str() );
|
pi->error_string = ssprintf( "'<%s> ... </%s>' is not well-formed.", m_sName.c_str(), closename.c_str() );
|
||||||
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user