[Scummvm-cvs-logs] SF.net SVN: scummvm:[34719] scummvm/trunk/gui/themebrowser.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Oct 2 19:20:21 CEST 2008


Revision: 34719
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34719&view=rev
Author:   fingolfin
Date:     2008-10-02 17:20:21 +0000 (Thu, 02 Oct 2008)

Log Message:
-----------
Fix for bug #2142743: Assertion on clicking "Theme" in Options

Modified Paths:
--------------
    scummvm/trunk/gui/themebrowser.cpp

Modified: scummvm/trunk/gui/themebrowser.cpp
===================================================================
--- scummvm/trunk/gui/themebrowser.cpp	2008-10-02 17:17:18 UTC (rev 34718)
+++ scummvm/trunk/gui/themebrowser.cpp	2008-10-02 17:20:21 UTC (rev 34719)
@@ -174,11 +174,17 @@
 	Common::String type;
 
 	out.file = node.getName();
+	
+	// Only accept .ini and .zip fies
+	if (!out.file.hasSuffix(".ini") && !out.file.hasSuffix(".zip"))
+		return false;
+	
 	// Remove the filename extension
-	while (out.file.lastChar() != '.') {
+	while (!out.file.empty() && out.file.lastChar() != '.') {
 		out.file.deleteLastChar();
 	}
-	out.file.deleteLastChar();
+	if (out.file.lastChar() == '.')
+		out.file.deleteLastChar();
 
 	if (out.file.empty())
 		return false;


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