[Scummvm-git-logs] scummvm branch-2-8 -> 17b85a946cbb2638422365232e5e4fd989014723

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


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

Summary:
e0b1826a31 Revert "MOHAWK: Fix French sheila version not starting. Bug #13920"
17b85a946c Revert "COMMON: Add a mode to the INI parser to ignore garbage in some files"


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

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

This reverts commit 872b107217df0f3a40dfc3f5f9eacf87b045532d.

Changed paths:
    engines/mohawk/livingbooks.cpp


diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 61a73971713..87f19b4b9f7 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -298,10 +298,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: 17b85a946cbb2638422365232e5e4fd989014723
    https://github.com/scummvm/scummvm/commit/17b85a946cbb2638422365232e5e4fd989014723
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-14T16:45:02+01:00

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

This reverts commit c69e98bad555e0160f49e13842156b0d0e1b80ad.

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 eb8e54658f7..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