mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Fix compressed BSA loading on non-Windows systems
This commit is contained in:
parent
b4a78a7e68
commit
be5faadff8
@ -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…
x
Reference in New Issue
Block a user