From 9f7aac4f2b81f202512b06228e9699850a70d90d Mon Sep 17 00:00:00 2001 From: Starfelll <37783752+Starfelll@users.noreply.github.com> Date: Thu, 9 Jan 2025 02:45:21 +0800 Subject: [PATCH] vpkpp: always use forward slashes in PackFile paths --- src/vpkpp/PackFile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vpkpp/PackFile.cpp b/src/vpkpp/PackFile.cpp index 614cbf5f5..d88978870 100644 --- a/src/vpkpp/PackFile.cpp +++ b/src/vpkpp/PackFile.cpp @@ -107,7 +107,9 @@ void fixFilePathForWindows(std::string& path) { } // namespace PackFile::PackFile(std::string fullFilePath_) - : fullFilePath(std::move(fullFilePath_)) {} + : fullFilePath(std::move(fullFilePath_)) { + string::normalizeSlashes(this->fullFilePath); +} std::unique_ptr PackFile::open(const std::string& path, const EntryCallback& callback) { auto extension = std::filesystem::path{path}.extension().string(); @@ -583,7 +585,7 @@ std::string_view PackFile::getFilepath() const { } std::string PackFile::getTruncatedFilepath() const { - return (std::filesystem::path{this->fullFilePath}.parent_path() / this->getTruncatedFilestem()).string(); + return std::filesystem::path{this->fullFilePath}.parent_path().string() + '/' + this->getTruncatedFilestem(); } std::string PackFile::getFilename() const {