aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ini-file.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/common/ini-file.cpp b/common/ini-file.cpp
index 1bf0a0eec6..d35c1e8d16 100644
--- a/common/ini-file.cpp
+++ b/common/ini-file.cpp
@@ -145,12 +145,15 @@ bool INIFile::loadFromStream(SeekableReadStream &stream) {
// Split string at '=' into 'key' and 'value'. First, find the "=" delimeter.
const char *p = strchr(t, '=');
- if (!p)
- error("Config file buggy: Junk found in line line %d: '%s'", lineno, t);
-
- // Extract the key/value pair
- kv.key = String(t, p);
- kv.value = String(p + 1);
+ if (!p) {
+ warning("Config file buggy: Junk found in line line %d: '%s'", lineno, t);
+ kv.key = String(t);
+ kv.value.clear();
+ } else {
+ // Extract the key/value pair
+ kv.key = String(t, p);
+ kv.value = String(p + 1);
+ }
// Trim of spaces
kv.key.trim();