This commit is contained in:
Steve Checkoway
2006-02-19 11:24:37 +00:00
parent 2c99a2b194
commit 4c593087a3
2 changed files with 27 additions and 22 deletions
+12 -7
View File
@@ -46,15 +46,18 @@ void MsdFile::ReadBuf( char *buf, int len )
if( i+1 < len && buf[i] == '/' && buf[i+1] == '/' )
{
/* //; erase with spaces until newline */
do {
do
{
buf[i] = ' ';
i++;
} while(i < len && buf[i] != '\n');
}
while( i < len && buf[i] != '\n' );
continue;
}
if(ReadingValue && buf[i] == '#') {
if( ReadingValue && buf[i] == '#' )
{
/* Unfortunately, many of these files are missing ;'s.
* If we get a # when we thought we were inside a value, assume we
* missed the ;. Back up and end the value. */
@@ -70,7 +73,8 @@ void MsdFile::ReadBuf( char *buf, int len )
break;
}
if(!FirstChar) {
if( !FirstChar )
{
/* Oops, we're not; handle this like a regular character. */
i++;
continue;
@@ -85,7 +89,8 @@ void MsdFile::ReadBuf( char *buf, int len )
}
/* # starts a new value. */
if(!ReadingValue && buf[i] == '#') {
if( !ReadingValue && buf[i] == '#' )
{
AddValue();
ReadingValue=true;
}
@@ -160,8 +165,8 @@ void MsdFile::ReadFromString( const RString &sString )
RString MsdFile::GetParam(unsigned val, unsigned par) const
{
if(val >= GetNumValues()) return RString();
if(par >= GetNumParams(val)) return RString();
if( val >= GetNumValues() || par >= GetNumParams(val) )
return RString();
return values[val].params[par];
}