aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-10-02 17:20:21 +0000
committerMax Horn2008-10-02 17:20:21 +0000
commitc77124ff50dee8864a94a31b4a0f2a588daed445 (patch)
tree08409544aa88e69bb109d4694402f747719937ac
parent0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e (diff)
downloadscummvm-rg350-c77124ff50dee8864a94a31b4a0f2a588daed445.tar.gz
scummvm-rg350-c77124ff50dee8864a94a31b4a0f2a588daed445.tar.bz2
scummvm-rg350-c77124ff50dee8864a94a31b4a0f2a588daed445.zip
Fix for bug #2142743: Assertion on clicking "Theme" in Options
svn-id: r34719
-rw-r--r--gui/themebrowser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp
index bf74c16e2f..2c1c542319 100644
--- a/gui/themebrowser.cpp
+++ b/gui/themebrowser.cpp
@@ -174,11 +174,17 @@ bool ThemeBrowser::isTheme(const Common::FSNode &node, Entry &out) {
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;