Skip to content

Commit

Permalink
vpkpp: always use forward slashes in PackFile paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Starfelll authored and craftablescience committed Jan 27, 2025
1 parent 464e2f6 commit 353aee7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vpkpp/PackFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> PackFile::open(const std::string& path, const EntryCallback& callback) {
auto extension = std::filesystem::path{path}.extension().string();
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 353aee7

Please sign in to comment.