- Fixed: Keys bound in a custom key section would unbind the key in the

main game section.


SVN r1409 (trunk)
This commit is contained in:
Randy Heit 2009-02-07 01:14:36 +00:00
commit 8d9bc8cc67
5 changed files with 80 additions and 19 deletions

View file

@ -332,6 +332,40 @@ void FConfigFile::ClearCurrentSection ()
}
}
//====================================================================
//
// FConfigFile :: ClearKey
//
// Removes a key from the current section, if found. If there are
// duplicates, only the first is removed.
//
//====================================================================
void FConfigFile::ClearKey(const char *key)
{
if (CurrentSection->RootEntry == NULL)
{
return;
}
FConfigEntry **prober = &CurrentSection->RootEntry, *probe = *prober;
while (probe != NULL && stricmp(probe->Key, key) != 0)
{
prober = &probe->Next;
probe = *prober;
}
if (probe != NULL)
{
*prober = probe->Next;
if (CurrentSection->LastEntryPtr == &probe->Next)
{
CurrentSection->LastEntryPtr = prober;
}
delete[] probe->Value;
delete[] (char *)probe;
}
}
//====================================================================
//
// FConfigFile :: SectionIsEmpty