[Scummvm-cvs-logs] CVS: scummvm/base gameDetector.cpp,1.16,1.17

Max Horn fingolfin at users.sourceforge.net
Thu Oct 9 04:16:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1:/tmp/cvs-serv19569/base

Modified Files:
	gameDetector.cpp 
Log Message:
make khaleks correct fix a bit nicer; and add similar safety nets to the other parser...() methods

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/gameDetector.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- gameDetector.cpp	9 Oct 2003 06:52:28 -0000	1.16
+++ gameDetector.cpp	9 Oct 2003 11:15:54 -0000	1.17
@@ -500,6 +500,9 @@
 }
 
 int GameDetector::parseGraphicsMode(const String &str) {
+	if (str.isEmpty())
+		return -1;
+
 	const char *s = str.c_str();
 	const GraphicsMode *gm = gfx_modes;
 	while (gm->name) {
@@ -513,6 +516,9 @@
 }
 
 Language GameDetector::parseLanguage(const String &str) {
+	if (str.isEmpty())
+		return UNK_LANG;
+
 	const char *s = str.c_str();
 	const LanguageDescription *l = languages;
 	while (l->name) {
@@ -525,6 +531,9 @@
 }
 
 Platform GameDetector::parsePlatform(const String &str) {
+	if (str.isEmpty())
+		return kPlatformUnknown;
+
 	const char *s = str.c_str();
 	if (!scumm_stricmp(s, "pc"))
 		return kPlatformPC;
@@ -539,7 +548,7 @@
 }
 
 int GameDetector::parseMusicDriver(const String &str) {
-	if (str == String::emptyString)
+	if (str.isEmpty())
 		return -1;
 
 	const char *s = str.c_str();





More information about the Scummvm-git-logs mailing list