mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +00:00
Optimize SourceFile::ReadInclude
svn path=/branches/xmlbuildsystem/; revision=15433
This commit is contained in:
parent
083a71c9f2
commit
892a2cc592
1 changed files with 38 additions and 25 deletions
|
@ -94,6 +94,8 @@ SourceFile::ReadInclude ( string& filename,
|
|||
bool include = false;
|
||||
p++;
|
||||
SkipWhitespace ();
|
||||
if ( *p == 'i' )
|
||||
{
|
||||
if ( strncmp ( p, "include ", 8 ) == 0 )
|
||||
{
|
||||
p += 8;
|
||||
|
@ -110,18 +112,29 @@ SourceFile::ReadInclude ( string& filename,
|
|||
if ( include )
|
||||
{
|
||||
SkipWhitespace ();
|
||||
if ( p < end && *p == '<' || *p == '"' )
|
||||
if ( p < end )
|
||||
{
|
||||
register char ch = *p;
|
||||
if ( ch == '<' || ch == '"' )
|
||||
{
|
||||
p++;
|
||||
filename.resize ( MAX_PATH );
|
||||
int i = 0;
|
||||
while ( p < end && *p != '>' && *p != '"' && *p != '\n' )
|
||||
filename[i++] = *p++;
|
||||
ch = *p;
|
||||
while ( p < end && ch != '>' && ch != '"' && ch != '\n' )
|
||||
{
|
||||
filename[i++] = *p;
|
||||
p++;
|
||||
if ( p < end )
|
||||
ch = *p;
|
||||
}
|
||||
filename.resize ( i );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
filename = "";
|
||||
|
|
Loading…
Reference in a new issue