[Scummvm-cvs-logs] SF.net SVN: scummvm:[33136] scummvm/trunk/base

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jul 20 18:28:07 CEST 2008


Revision: 33136
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33136&view=rev
Author:   fingolfin
Date:     2008-07-20 16:28:06 +0000 (Sun, 20 Jul 2008)

Log Message:
-----------
Fixed nasty bug in findPlainGameDescriptor -- contrary to is documentation, it would not return 0 upon failure to find a match, but rather a (0,0) record.

Modified Paths:
--------------
    scummvm/trunk/base/game.cpp
    scummvm/trunk/base/game.h

Modified: scummvm/trunk/base/game.cpp
===================================================================
--- scummvm/trunk/base/game.cpp	2008-07-20 16:27:12 UTC (rev 33135)
+++ scummvm/trunk/base/game.cpp	2008-07-20 16:28:06 UTC (rev 33136)
@@ -32,10 +32,10 @@
 	const PlainGameDescriptor *g = list;
 	while (g->gameid) {
 		if (0 == scumm_stricmp(gameid, g->gameid))
-			break;
+			return g;
 		g++;
 	}
-	return g;
+	return 0;
 }
 
 void GameDescriptor::updateDesc(const char *extra) {

Modified: scummvm/trunk/base/game.h
===================================================================
--- scummvm/trunk/base/game.h	2008-07-20 16:27:12 UTC (rev 33135)
+++ scummvm/trunk/base/game.h	2008-07-20 16:28:06 UTC (rev 33136)
@@ -48,7 +48,7 @@
 /**
  * Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor
  * matching the given gameid. If not match is found return 0.
- * The end of the list marked by a PlainGameDescriptor with gameid equal to 0.
+ * The end of the list must marked by a PlainGameDescriptor with gameid equal to 0.
  */
 const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list