git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1953 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -47,18 +47,19 @@ namespace OpenRa.FileFormats
|
||||
|
||||
bool ProcessEntry( string line )
|
||||
{
|
||||
Match m = entryPattern.Match( line );
|
||||
if( m == null || !m.Success )
|
||||
return false;
|
||||
int comment = line.IndexOf(';');
|
||||
if (comment >= 0)
|
||||
line = line.Substring(0, comment);
|
||||
|
||||
if( currentSection == null )
|
||||
throw new InvalidOperationException( "No current INI section" );
|
||||
int eq = line.IndexOf('=');
|
||||
if (eq < 0)
|
||||
return false;
|
||||
|
||||
string keyName = m.Groups[ 1 ].Value;
|
||||
string keyValue = m.Groups[ 2 ].Value;
|
||||
|
||||
currentSection.Add( keyName, keyValue );
|
||||
if (currentSection == null)
|
||||
throw new InvalidOperationException("No current INI section");
|
||||
|
||||
currentSection.Add(line.Substring(0, eq),
|
||||
line.Substring(eq + 1, line.Length - eq - 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user