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

pull/155/head
rubidium 15 years ago
parent 7025440aff
commit 41286d0915

@ -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