force M_SaveDefaults() to always write the help string (#168)

* force M_SaveDefaults() to always write the help string

* fix gcc build

* add comment
This commit is contained in:
Roman Fomin 2021-04-19 23:58:25 +07:00 committed by GitHub
parent fd60d9fdfe
commit ce2c0cc30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1983,7 +1983,7 @@ void M_SaveDefaults (void)
{
char tmpfile[PATH_MAX+1];
register default_t *dp;
int line, blanks;
int blanks;
FILE *f;
// killough 10/98: for when exiting early
@ -2009,11 +2009,14 @@ void M_SaveDefaults (void)
// killough 10/98: output comment lines which were read in during input
for (blanks = 1, line = 0, dp = defaults; ; dp++, blanks = 0)
for (blanks = 1, dp = defaults; ; dp++, blanks = 0)
{
int brackets = 0;
config_t value;
// Always write a help string to avoid
// incorrect entries in the user config
/*
for (;line < comment && comments[line].line <= dp-defaults; line++)
if (*comments[line].text != '[' || (brackets = 1, config_help))
@ -2026,6 +2029,7 @@ void M_SaveDefaults (void)
putc('\n',f) == EOF)) ||
fputs(comments[line].text, f) == EOF)
goto error;
*/
// If we still haven't seen any blanks,
// Output a blank line for separation