From f52a96e1f4d2ac3abbdb4d47b7cecfab761db1db Mon Sep 17 00:00:00 2001
From: Andrei Prykhodko
Date: Mon, 19 Aug 2019 14:04:21 +0300
Subject: COMMON: fixed reading ini files which have not value for key

---
 common/ini-file.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'common')

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();
-- 
cgit v1.2.3