From c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 24 Nov 2011 04:42:19 +0300 Subject: Fix possible file name conflicts between client data files and skins. --- src/gui/theme.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/gui/theme.cpp') 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; -- cgit v1.2.3-60-g2f50