- Fixed: Do not write the config file if DoGameSetup() has not been called yet.

SVN r3653 (trunk)
This commit is contained in:
Randy Heit 2012-05-15 21:47:15 +00:00
commit d6cd9b430d
3 changed files with 14 additions and 1 deletions

View file

@ -53,6 +53,7 @@ FConfigFile::FConfigFile ()
LastSectionPtr = &Sections;
CurrentEntry = NULL;
PathName = "";
OkayToWrite = true;
}
//====================================================================
@ -70,6 +71,7 @@ FConfigFile::FConfigFile (const char *pathname,
CurrentEntry = NULL;
ChangePathName (pathname);
LoadConfigFile (nosechandler, userdata);
OkayToWrite = true;
}
//====================================================================
@ -85,6 +87,7 @@ FConfigFile::FConfigFile (const FConfigFile &other)
CurrentEntry = NULL;
ChangePathName (other.PathName);
*this = other;
OkayToWrite = other.OkayToWrite;
}
//====================================================================
@ -695,6 +698,12 @@ char *FConfigFile::ReadLine (char *string, int n, void *file) const
bool FConfigFile::WriteConfigFile () const
{
if (!OkayToWrite)
{ // Pretend it was written anyway so that the user doesn't get
// any "config not written" notifications.
return true;
}
FILE *file = fopen (PathName, "w");
FConfigSection *section;
FConfigEntry *entry;