Skip to content

Commit

Permalink
Merge pull request EasyRPG#543 from fdelapena/master
Browse files Browse the repository at this point in the history
Filefinder: Fix subfolder finding on non-win32 filesystems
  • Loading branch information
fdelapena committed Aug 26, 2015
2 parents d77d360 + 84b3fbb commit d082a55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/filefinder.cpp
Expand Up @@ -87,14 +87,18 @@ namespace {
std::string const lower_dir = Utils::LowerCase(dir);
std::string const escape_symbol = Player::escape_symbol;
std::string corrected_name = Utils::LowerCase(name);
#ifdef _WIN32
if (escape_symbol != "\\") {
#endif
std::size_t escape_pos = corrected_name.find(escape_symbol);
while (escape_pos != std::string::npos) {
corrected_name.erase(escape_pos, escape_symbol.length());
corrected_name.insert(escape_pos, "/");
escape_pos = corrected_name.find(escape_symbol);
}
#ifdef _WIN32
}
#endif

string_map::const_iterator dir_it = tree.directories.find(lower_dir);
if(dir_it == tree.directories.end()) { return boost::none; }
Expand Down

0 comments on commit d082a55

Please sign in to comment.