(svn r16018) -Fix (r16014): properly escape IPv6 style ([::]) addresses so they aren't seen as new groups.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 15 years ago
parent c8b495fb38
commit 930bc73e7a

@ -283,7 +283,8 @@ bool IniFile::SaveToDisk(const char *filename)
if (item->comment != NULL) fputs(item->comment, f);
/* protect item->name with quotes if needed */
if (strchr(item->name, ' ') != NULL) {
if (strchr(item->name, ' ') != NULL ||
item->name[0] == '[') {
fprintf(f, "\"%s\"", item->name);
} else {
fprintf(f, "%s", item->name);

@ -80,6 +80,7 @@ static const char *_list_group_names[] = {
"bans",
"newgrf",
"servers",
"server_bind_addresses",
NULL
};

Loading…
Cancel
Save