Skip to content

Commit

Permalink
fix(vpkpp): add directory methods were a bit busted
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Aug 22, 2024
1 parent 976207c commit 1b986ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vpkpp/PackFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ void PackFile::addDirectory(const std::string& entryBaseDir_, const std::string&
return;
}

const auto entryBaseDir = this->cleanEntryPath(entryBaseDir_) + '/';
const auto dirLen = std::filesystem::absolute(dir).string().length();
auto entryBaseDir = this->cleanEntryPath(entryBaseDir_);
if (!entryBaseDir.empty()) {
entryBaseDir += '/';
}
const auto dirLen = std::filesystem::absolute(dir).string().length() + 1;
for (const auto& file : std::filesystem::recursive_directory_iterator(dir, std::filesystem::directory_options::skip_permission_denied)) {
if (!file.is_regular_file()) {
continue;
Expand Down

0 comments on commit 1b986ba

Please sign in to comment.