aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-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;