mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #248 from JayXon/simplifyParseName
Simplify ParseName
This commit is contained in:
commit
5f06297230
14
tinyxml2.cpp
14
tinyxml2.cpp
|
@ -140,18 +140,18 @@ char* StrPair::ParseName( char* p )
|
||||||
if ( !p || !(*p) ) {
|
if ( !p || !(*p) ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if ( !XMLUtil::IsNameStartChar( *p ) ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
char* const start = p;
|
char* const start = p;
|
||||||
|
++p;
|
||||||
while( *p && ( p == start ? XMLUtil::IsNameStartChar( *p ) : XMLUtil::IsNameChar( *p ) )) {
|
while ( *p && XMLUtil::IsNameChar( *p ) ) {
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( p > start ) {
|
Set( start, p, 0 );
|
||||||
Set( start, p, 0 );
|
return p;
|
||||||
return p;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue