mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Fix compressed BSA loading on non-Windows systems
This commit is contained in:
parent
b4a78a7e68
commit
be5faadff8
1 changed files with 7 additions and 2 deletions
|
@ -285,10 +285,15 @@ void CompressedBSAFile::readHeader()
|
||||||
|
|
||||||
CompressedBSAFile::FileRecord CompressedBSAFile::getFileRecord(const std::string& str) const
|
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 stem = p.stem().string();
|
||||||
std::string ext = p.extension().string();
|
std::string ext = p.extension().string();
|
||||||
std::string filename = p.filename().string();
|
|
||||||
p.remove_filename();
|
p.remove_filename();
|
||||||
|
|
||||||
std::string folder = p.string();
|
std::string folder = p.string();
|
||||||
|
|
Loading…
Reference in a new issue