diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/config-file.cpp | 6 | ||||
| -rw-r--r-- | common/stream.h | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/common/config-file.cpp b/common/config-file.cpp index 9b69452b2e..159fa778f7 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -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') diff --git a/common/stream.h b/common/stream.h index ca2ad6721e..1294929149 100644 --- a/common/stream.h +++ b/common/stream.h @@ -388,6 +388,13 @@ public: * err() or eos() to determine whether an exception occurred. */ virtual String readLine(); + + /** + * Return the beginning offset in the stream, which defaults to 0. + * + * @return the beginning offset of the stream + */ + virtual uint32 getBeginOffset() { return 0; } }; @@ -447,6 +454,7 @@ public: virtual int32 pos() const { return _pos - _begin; } virtual int32 size() const { return _end - _begin; } + virtual uint32 getBeginOffset() { return _begin; } virtual bool seek(int32 offset, int whence = SEEK_SET); }; |
