Merge pull request #2138 from Capostrophic/bsa

Fix compressed BSA loading on non-Windows systems
pull/2139/head
Bret Curtis 6 years ago committed by GitHub
commit c2fd4c1f46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -285,10 +285,15 @@ void CompressedBSAFile::readHeader()
CompressedBSAFile::FileRecord CompressedBSAFile::getFileRecord(const std::string& str) const
{
boost::filesystem::path p(str);
// Force-convert the path into something both Windows and UNIX can handle first
// to make sure Boost doesn't think the entire path is the filename on Linux
// and subsequently purge it to determine the file folder.
std::string path = str;
std::replace(path.begin(), path.end(), '\\', '/');
boost::filesystem::path p(path);
std::string stem = p.stem().string();
std::string ext = p.extension().string();
std::string filename = p.filename().string();
p.remove_filename();
std::string folder = p.string();

Loading…
Cancel
Save