- 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:
parent
f867f40bab
commit
8d9bc8cc67
5 changed files with 80 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue