Fix dots in path names.

This commit is contained in:
Ben Vanik 2015-01-04 21:08:47 -08:00
parent caad11b30b
commit a82629efd5
1 changed files with 4 additions and 0 deletions

View File

@ -32,7 +32,11 @@ FileSystem::~FileSystem() {
} }
fs::FileSystemType FileSystem::InferType(const std::wstring& local_path) { fs::FileSystemType FileSystem::InferType(const std::wstring& local_path) {
auto last_slash = local_path.find_last_of(poly::path_separator);
auto last_dot = local_path.find_last_of('.'); auto last_dot = local_path.find_last_of('.');
if (last_dot < last_slash) {
last_dot = std::wstring::npos;
}
if (last_dot == std::wstring::npos) { if (last_dot == std::wstring::npos) {
// Likely an STFS container. // Likely an STFS container.
return FileSystemType::STFS_TITLE; return FileSystemType::STFS_TITLE;