Fix a section-titling bug in the inifile code.

master
Freddie Witherden 2010-12-30 21:17:18 +00:00
parent 5362cf2217
commit 7b7b2b8e0e
1 changed files with 3 additions and 4 deletions

View File

@ -485,11 +485,10 @@ void inifile_save_as(inifile *inif, const char *path)
const char *currsec = inifile_get_section(inif, i);
/*
* Only print the section title if there are multiple sections in the
* file; otherwise if we are the only section just dump the keys
* directly.
* Print the section title if there are either multiple sections in the
* file or if the singular section has been explicitly named.
*/
if (nsec > 1)
if (nsec > 1 || strcmp("main", currsec) != 0)
{
// Print out the section title
PHYSFS_printf(f, "[%s]\n", currsec);