Skip to content

Commit

Permalink
fix(vpkpp): add directory methods were STILL a bit busted
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Aug 22, 2024
1 parent 1b986ba commit c866128
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 @@ -258,16 +258,19 @@ void PackFile::addDirectory(const std::string& entryBaseDir_, const std::string&
if (!file.is_regular_file()) {
continue;
}
std::string absPath;
std::string entryPath;
try {
entryPath = this->cleanEntryPath(entryBaseDir + std::filesystem::absolute(file.path()).string().substr(dirLen));
absPath = std::filesystem::absolute(file.path()).string();
string::normalizeSlashes(absPath);
entryPath = this->cleanEntryPath(entryBaseDir + absPath.substr(dirLen));
} catch (const std::exception&) {
continue; // Likely a Unicode error, unsupported filename
}
if (entryPath.empty()) {
continue;
}
this->addEntry(entryPath, file.path().string(), creation ? creation(entryPath) : EntryOptions{});
this->addEntry(entryPath, absPath, creation ? creation(entryPath) : EntryOptions{});
}
}

Expand Down

0 comments on commit c866128

Please sign in to comment.