[Scummvm-cvs-logs] SF.net SVN: scummvm:[55036] scummvm/trunk/engines/mohawk/livingbooks.cpp

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Sat Dec 25 19:45:48 CET 2010


Revision: 55036
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55036&view=rev
Author:   fuzzie
Date:     2010-12-25 18:45:48 +0000 (Sat, 25 Dec 2010)

Log Message:
-----------
MOHAWK: LB CD-ROM title prefixes aren't Windows-specific

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/livingbooks.cpp

Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-25 18:45:29 UTC (rev 55035)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-25 18:45:48 UTC (rev 55036)
@@ -595,7 +595,18 @@
 }
 
 Common::String MohawkEngine_LivingBooks::getFileNameFromConfig(const Common::String &section, const Common::String &key) {
-	Common::String x = getStringFromConfig(section, key);
+	Common::String string = getStringFromConfig(section, key);
+	Common::String x;
+
+	uint32 i = 0;
+	if (string.hasPrefix("//")) {
+		// skip "//CD-ROM Title/" prefixes which we don't care about
+		i = 3;
+		while (i < string.size() && string[i - 1] != '/')
+			i++;
+	}
+	x = string.c_str() + i;
+
 	return (getPlatform() == Common::kPlatformMacintosh) ? convertMacFileName(x) : convertWinFileName(x);
 }
 
@@ -633,15 +644,7 @@
 Common::String MohawkEngine_LivingBooks::convertWinFileName(const Common::String &string) {
 	Common::String filename;
 
-	uint32 i = 0;
-	if (string.hasPrefix("//")) {
-		// skip "//CD-ROM Title/" prefixes which we don't care about
-		i = 3;
-		while (i < string.size() && string[i - 1] != '/')
-			i++;
-	}
-
-	for (; i < string.size(); i++) {
+	for (uint32 i = 0; i < string.size(); i++) {
 		if (string[i] == '\\')
 			filename += '/';
 		else


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