mirror of https://github.com/AxioDL/tinyxml2.git
fix merge
This commit is contained in:
commit
62d1c5a739
10
tinyxml2.cpp
10
tinyxml2.cpp
|
@ -136,16 +136,12 @@ char* StrPair::ParseName( char* p )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !XMLUtil::IsAlpha( *p ) ) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while( *p && (
|
while( *p && (
|
||||||
XMLUtil::IsAlphaNum( (unsigned char) *p )
|
XMLUtil::IsAlphaNum( (unsigned char) *p )
|
||||||
|| *p == '_'
|
|| *p == '_'
|
||||||
|| *p == '-'
|
|| *p == ':'
|
||||||
|| *p == '.'
|
|| (*p == '-' && p>start ) // can be in a name, but not lead it.
|
||||||
|| *p == ':' ))
|
|| (*p == '.' && p>start ) )) // can be in a name, but not lead it.
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
|
@ -940,6 +940,13 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
XMLTest( "QueryBoolText", boolValue, true, false );
|
XMLTest( "QueryBoolText", boolValue, true, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const char* xml = "<element><_sub/><:sub/><sub:sub/><sub-sub/></element>";
|
||||||
|
XMLDocument doc;
|
||||||
|
doc.Parse( xml );
|
||||||
|
XMLTest( "Non-alpha element lead letter parses.", doc.Error(), false );
|
||||||
|
}
|
||||||
|
|
||||||
// ----------- Whitespace ------------
|
// ----------- Whitespace ------------
|
||||||
{
|
{
|
||||||
const char* xml = "<element>"
|
const char* xml = "<element>"
|
||||||
|
@ -958,7 +965,6 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
XMLTest( "Whitespace collapse", "This is ' text '", parent->GetText() );
|
XMLTest( "Whitespace collapse", "This is ' text '", parent->GetText() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ----------- Performance tracking --------------
|
// ----------- Performance tracking --------------
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue