Add Mohawk engine code. Part 2/3: common code changes.

svn-id: r46728
This commit is contained in:
Eugene Sandulenko 2009-12-29 23:20:23 +00:00
parent 0ea022d076
commit fb8ecae7f1
7 changed files with 124 additions and 27 deletions

View file

@ -95,7 +95,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
if (line.size() == 0) {
// Do nothing
} else if (line[0] == '#') {
} else if (line[0] == '#' || line[0] == ';') {
// Accumulate comments here. Once we encounter either the start
// of a new section, or a key-value-pair, we associate the value
// of the 'comment' variable with that entity.
@ -116,8 +116,8 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
const char *p = line.c_str() + 1;
// Get the section name, and check whether it's valid (that
// is, verify that it only consists of alphanumerics,
// dashes and underscores).
while (*p && (isalnum(*p) || *p == '-' || *p == '_'))
// periods, dashes and underscores).
while (*p && (isalnum(*p) || *p == '-' || *p == '_' || *p == '.'))
p++;
if (*p == '\0')