diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-24 04:42:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-24 04:42:19 +0300 |
commit | c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7 (patch) | |
tree | de6e2e30ec40eb49490ab32ef738b64d059d7fbf /src | |
parent | f8cd17e234018066b03b995e92a09981d3d927f8 (diff) | |
download | manaplus-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.gz manaplus-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.bz2 manaplus-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.xz manaplus-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.zip |
Fix possible file name conflicts between client data files and skins.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/theme.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 0246a5b62..9aa6bb956 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -599,12 +599,17 @@ std::string Theme::resolveThemePath(const std::string &path) else file = path; - // Might be a valid path already - if (PHYSFS_exists(file.c_str())) - return path; + // File with path + if (file.find('/') != std::string::npos) + { + // Might be a valid path already + if (PHYSFS_exists(file.c_str())) + return path; + } // Try the theme file = getThemePath() + "/" + file; + if (PHYSFS_exists(file.c_str())) return getThemePath() + "/" + path; |