[Scummvm-git-logs] scummvm master -> f52a96e1f4d2ac3abbdb4d47b7cecfab761db1db

bluegr bluegr at gmail.com
Mon Aug 19 20:50:17 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f52a96e1f4 COMMON: fixed reading ini files which have not value for key


Commit: f52a96e1f4d2ac3abbdb4d47b7cecfab761db1db
    https://github.com/scummvm/scummvm/commit/f52a96e1f4d2ac3abbdb4d47b7cecfab761db1db
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2019-08-19T21:50:14+03:00

Commit Message:
COMMON: fixed reading ini files which have not value for key

Changed paths:
    common/ini-file.cpp


diff --git a/common/ini-file.cpp b/common/ini-file.cpp
index 1bf0a0e..d35c1e8 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();





More information about the Scummvm-git-logs mailing list