aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2010-12-25 18:45:48 +0000
committerAlyssa Milburn2010-12-25 18:45:48 +0000
commit4c0b02fe21eebea3a55e75d1d7dd043447a12e83 (patch)
tree4dc7e105b9578163c657f3ffcea9ac042e74c70f /engines
parent85da9de3bf0297d95ed0e335355dcfce6412931c (diff)
downloadscummvm-rg350-4c0b02fe21eebea3a55e75d1d7dd043447a12e83.tar.gz
scummvm-rg350-4c0b02fe21eebea3a55e75d1d7dd043447a12e83.tar.bz2
scummvm-rg350-4c0b02fe21eebea3a55e75d1d7dd043447a12e83.zip
MOHAWK: LB CD-ROM title prefixes aren't Windows-specific
svn-id: r55036
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/livingbooks.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index a54aa11532..8133c51ff7 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -595,7 +595,18 @@ int MohawkEngine_LivingBooks::getIntFromConfig(const Common::String &section, co
}
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::convertMacFileName(const Common::String
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