diff options
author | Filippos Karapetis | 2016-08-26 11:25:39 +0300 |
---|---|---|
committer | Filippos Karapetis | 2016-08-26 11:26:09 +0300 |
commit | ad693ee768ee3a4e79fafbb9dfb33d1169522456 (patch) | |
tree | bce4e0bc4f5a6e8e4e16e284119f890db1a1785d /engines | |
parent | 25b8f196cb89c60011667491734eb13874d9c9fb (diff) | |
download | scummvm-rg350-ad693ee768ee3a4e79fafbb9dfb33d1169522456.tar.gz scummvm-rg350-ad693ee768ee3a4e79fafbb9dfb33d1169522456.tar.bz2 scummvm-rg350-ad693ee768ee3a4e79fafbb9dfb33d1169522456.zip |
SCI: Add a sanity check in wrapFilename(), as in unwrapFilename()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/sci.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 900dabe05a..86c0cffe15 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -923,14 +923,19 @@ Common::String SciEngine::getFilePrefix() const { } Common::String SciEngine::wrapFilename(const Common::String &name) const { - return getFilePrefix() + "-" + name; + Common::String prefix = getFilePrefix() + "-"; + if (name.hasPrefix(prefix.c_str())) + return name; + else + return prefix + name; } Common::String SciEngine::unwrapFilename(const Common::String &name) const { Common::String prefix = getFilePrefix() + "-"; if (name.hasPrefix(prefix.c_str())) return Common::String(name.c_str() + prefix.size()); - return name; + else + return name; } const char *SciEngine::getGameObjectName() { |