From 33f20a1f8565b4ee5d3570d4f221fe99eb044d87 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 30 Aug 2002 05:05:34 +0000 Subject: [PATCH] KSF files, at least, are often missing closing ;'s. Cope. --- stepmania/src/MsdFile.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/stepmania/src/MsdFile.cpp b/stepmania/src/MsdFile.cpp index 27303e76ae..f4030a1776 100644 --- a/stepmania/src/MsdFile.cpp +++ b/stepmania/src/MsdFile.cpp @@ -55,6 +55,7 @@ bool MsdFile::ReadFile( CString sNewPath ) m_iNumValues = 0; + bool ReadingValue=false; int i; for( i=0; i= 0 && !strchr("\r\n", m_szFileString[j]); --j) + { + if(m_szFileString[j] == ' ' || m_szFileString[j] == '\t') + continue; + + FirstChar = false; + break; + } + if(!FirstChar) { + /* Oops, we're not; handle this like a regular character. */ + break; + } + + for(j = i-1; j >= 0 && isspace(m_szFileString[j]); --j) + m_szFileString[j] = 0; + } + + ReadingValue=true; m_iNumValues++; int iCurValueIndex = m_iNumValues-1; m_iNumParams[iCurValueIndex] = 1; @@ -83,6 +110,7 @@ bool MsdFile::ReadFile( CString sNewPath ) // fast forward until just before the next '#' while( m_szFileString[i+1] != '#' && i