COMMON: fixed reading ini files with section containing more than one word

This commit is contained in:
Andrei Prykhodko 2019-04-08 23:07:14 +03:00 committed by Filippos Karapetis
parent 66813c9fc2
commit 8469b8749c

View file

@ -30,7 +30,7 @@ namespace Common {
bool INIFile::isValidName(const String &name) { bool INIFile::isValidName(const String &name) {
const char *p = name.c_str(); const char *p = name.c_str();
while (*p && (isAlnum(*p) || *p == '-' || *p == '_' || *p == '.')) while (*p && (isAlnum(*p) || *p == '-' || *p == '_' || *p == '.' || *p == ' '))
p++; p++;
return *p == 0; return *p == 0;
} }
@ -108,7 +108,7 @@ bool INIFile::loadFromStream(SeekableReadStream &stream) {
// is, verify that it only consists of alphanumerics, // is, verify that it only consists of alphanumerics,
// periods, dashes and underscores). Mohawk Living Books games // periods, dashes and underscores). Mohawk Living Books games
// can have periods in their section names. // can have periods in their section names.
while (*p && (isAlnum(*p) || *p == '-' || *p == '_' || *p == '.')) while (*p && (isAlnum(*p) || *p == '-' || *p == '_' || *p == '.' || *p == ' '))
p++; p++;
if (*p == '\0') if (*p == '\0')