assert if we're about to write an unparsable ini file

This commit is contained in:
Chris Danford
2006-01-05 07:36:09 +00:00
parent fb9d07e11b
commit f02ed66d59
+8 -1
View File
@@ -95,7 +95,14 @@ bool IniFile::WriteFile( RageFileBasic &f ) const
FOREACH_CONST_Attr( pKey, pAttr )
{
if( f.PutLine( ssprintf("%s=%s", pAttr->first.c_str(), pAttr->second.c_str()) ) == -1 )
const RString &sName = pAttr->first;
const RString &sValue = pAttr->second;
// TODO: Are there esacpe rules for these?
DEBUG_ASSERT( sName.find('\n') == sName.npos );
DEBUG_ASSERT( sName.find('=') == sName.npos );
if( f.PutLine( ssprintf("%s=%s", sName.c_str(), sValue.c_str()) ) == -1 )
{
m_sError = f.GetError();
return false;