diff options
author | Max Horn | 2008-10-02 17:20:21 +0000 |
---|---|---|
committer | Max Horn | 2008-10-02 17:20:21 +0000 |
commit | c77124ff50dee8864a94a31b4a0f2a588daed445 (patch) | |
tree | 08409544aa88e69bb109d4694402f747719937ac /gui | |
parent | 0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e (diff) | |
download | scummvm-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
Diffstat (limited to 'gui')
-rw-r--r-- | gui/themebrowser.cpp | 10 |
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; |