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

sev- noreply at scummvm.org
Thu Dec 14 15:45:14 UTC 2023


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

Summary:
61c734fcb4 Revert "COMMON: Fix strictParser interpretation to follow the intent"
4cfa5e5ce6 Revert "MOHAWK: Fix French sheila version not starting. Bug #13920"
f8a627c6c9 Revert "COMMON: Add a mode to the INI parser to ignore garbage in some files"


Commit: 61c734fcb49f8cd8372fcf65ea6a82135e70b65c
    https://github.com/scummvm/scummvm/commit/61c734fcb49f8cd8372fcf65ea6a82135e70b65c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-14T16:43:41+01:00

Commit Message:
Revert "COMMON: Fix strictParser interpretation to follow the intent"

This reverts commit 75e96d70702208f61ac93f74f265295f85342c36.

Changed paths:
    common/formats/ini-file.cpp


diff --git a/common/formats/ini-file.cpp b/common/formats/ini-file.cpp
index eb8e54658f7..52204c1e435 100644
--- a/common/formats/ini-file.cpp
+++ b/common/formats/ini-file.cpp
@@ -116,7 +116,7 @@ bool INIFile::loadFromStream(SeekableReadStream &stream, bool strictParser) {
 
 		if (line.size() == 0) {
 			// Do nothing
-		} else if (!strictParser && !Common::isPrint(line[0])) {
+		} else if (strictParser && !Common::isPrint(line[0])) {
 			// Non-ASCII character at the beginning of the line, count lines
 			nonAsciilineCount++;
 		} else if (line[0] == '#' || line[0] == ';' || line.hasPrefix("//")) {


Commit: 4cfa5e5ce6c1b2044823aef0ea4faf34b953761d
    https://github.com/scummvm/scummvm/commit/4cfa5e5ce6c1b2044823aef0ea4faf34b953761d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-14T16:43:53+01:00

Commit Message:
Revert "MOHAWK: Fix French sheila version not starting. Bug #13920"

This reverts commit e3179f773adee9bc1e91da39dd4fad60b5bf6748.

Changed paths:
    engines/mohawk/livingbooks.cpp


diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index d162a6317e4..003bae180eb 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -302,10 +302,7 @@ void MohawkEngine_LivingBooks::pauseEngineIntern(bool pause) {
 
 void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) {
 	_bookInfoFile.allowNonEnglishCharacters();
-
-	// WORKAROUND: Sheila FR has garbage in INI file. Running parser in non-strict mode
-	// and ignore non-ASCII characters. Bug #13920
-	if (!_bookInfoFile.loadFromFile(filename, false))
+	if (!_bookInfoFile.loadFromFile(filename))
 		error("Could not open %s as a config file", filename.c_str());
 
 	_title = getStringFromConfig("BookInfo", "title");


Commit: f8a627c6c977058673b9cb71de8854c2f224cd47
    https://github.com/scummvm/scummvm/commit/f8a627c6c977058673b9cb71de8854c2f224cd47
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-14T16:43:56+01:00

Commit Message:
Revert "COMMON: Add a mode to the INI parser to ignore garbage in some files"

This reverts commit a2c3ea57018fc1ddf8cc42e786256918bb2a681c.

Changed paths:
    common/formats/ini-file.cpp
    common/formats/ini-file.h


diff --git a/common/formats/ini-file.cpp b/common/formats/ini-file.cpp
index 52204c1e435..32101f61fcd 100644
--- a/common/formats/ini-file.cpp
+++ b/common/formats/ini-file.cpp
@@ -59,23 +59,23 @@ void INIFile::clear() {
 	_sections.clear();
 }
 
-bool INIFile::loadFromFile(const String &filename, bool strictParser) {
+bool INIFile::loadFromFile(const String &filename) {
 	File file;
 	if (file.open(filename))
-		return loadFromStream(file, strictParser);
+		return loadFromStream(file);
 	else
 		return false;
 }
 
-bool INIFile::loadFromFileOrDataFork(const String &filename, bool strictParser) {
+bool INIFile::loadFromFileOrDataFork(const String &filename) {
 	SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(filename);
 	if (file)
-		return loadFromStream(*file, strictParser);
+		return loadFromStream(*file);
 	else
 		return false;
 }
 
-bool INIFile::loadFromSaveFile(const String &filename, bool strictParser) {
+bool INIFile::loadFromSaveFile(const String &filename) {
 	assert(g_system);
 	SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	SeekableReadStream *loadFile;
@@ -84,18 +84,17 @@ bool INIFile::loadFromSaveFile(const String &filename, bool strictParser) {
 	if (!(loadFile = saveFileMan->openForLoading(filename)))
 		return false;
 
-	bool status = loadFromStream(*loadFile, strictParser);
+	bool status = loadFromStream(*loadFile);
 	delete loadFile;
 	return status;
 }
 
-bool INIFile::loadFromStream(SeekableReadStream &stream, bool strictParser) {
+bool INIFile::loadFromStream(SeekableReadStream &stream) {
 	static const byte UTF8_BOM[] = {0xEF, 0xBB, 0xBF};
 	Section section;
 	KeyValue kv;
 	String comment;
 	int lineno = 0;
-	int nonAsciilineCount = 0;
 	section.name = _defaultSectionName;
 
 	// TODO: Detect if a section occurs multiple times (or likewise, if
@@ -116,9 +115,6 @@ bool INIFile::loadFromStream(SeekableReadStream &stream, bool strictParser) {
 
 		if (line.size() == 0) {
 			// Do nothing
-		} else if (strictParser && !Common::isPrint(line[0])) {
-			// Non-ASCII character at the beginning of the line, count lines
-			nonAsciilineCount++;
 		} else if (line[0] == '#' || line[0] == ';' || line.hasPrefix("//")) {
 			// Accumulate comments here. Once we encounter either the start
 			// of a new section, or a key-value-pair, we associate the value
@@ -202,9 +198,6 @@ bool INIFile::loadFromStream(SeekableReadStream &stream, bool strictParser) {
 			section.keys.push_back(kv);
 		}
 	}
-	if (nonAsciilineCount)
-		warning("loadFromStream(): %d lines with non-ASCII garbage ignored", nonAsciilineCount);
-
 
 	// Save last section
 	if (!section.name.empty())
diff --git a/common/formats/ini-file.h b/common/formats/ini-file.h
index 4a7c6583503..a2767d5c487 100644
--- a/common/formats/ini-file.h
+++ b/common/formats/ini-file.h
@@ -105,46 +105,10 @@ public:
 	/** Reset everything stored in this INI file. */
 	void	clear();
 
-	/**
-	 * Load configuration from a file.
-	 *
-	 * @param filename     Name of an INI file to parse
-	 * @param strictParser Do not allow garbage to be present in the file (default true)
-	 *
-	 * @return  True if file was parsed successfully
-	 */
-	bool	loadFromFile(const String &filename, bool strictParser = true);
-
-	/**
-	 * Load configuration from a file in MacBinary format.
-	 *
-	 * @param filename     Name of an INI file to parse
-	 * @param strictParser Do not allow garbage to be present in the file (default true)
-	 *
-	 * @return  True if file was parsed successfully
-	 */
-	bool	loadFromFileOrDataFork(const String &filename, bool strictParser = true);
-
-	/**
-	 * Load configuration from a save file.
-	 *
-	 * @param filename     Name of an INI file to parse
-	 * @param strictParser Do not allow garbage to be present in the file (default true)
-	 *
-	 * @return  True if file was parsed successfully
-	 */
-	bool	loadFromSaveFile(const String &filename, bool strictParser = true);
-
-	/**
-	 * Load configuration from a @ref SeekableReadStream.
-	 *
-	 * @param stream       Name of an stream to parse
-	 * @param strictParser Do not allow garbage to be present in the file (default true)
-	 *
-	 * @return  True if file was parsed successfully
-	 */
-	bool	loadFromStream(SeekableReadStream &stream, bool strictParser = true);
-
+	bool	loadFromFile(const String &filename); /*!< Load configuration from a file. */
+	bool	loadFromFileOrDataFork(const String &filename); /*!< Load configuration from a file in MacBinary format. */
+	bool	loadFromSaveFile(const String &filename); /*!< Load configuration from a save file. */
+	bool	loadFromStream(SeekableReadStream &stream); /*!< Load configuration from a @ref SeekableReadStream. */
 	bool	saveToFile(const String &filename); /*!< Save the current configuration to a file. */
 	bool	saveToSaveFile(const String &filename); /*!< Save the current configuration to a save file. */
 	bool	saveToStream(WriteStream &stream); /*!< Save the current configuration to a @ref WriteStream. */




More information about the Scummvm-git-logs mailing list