Update path handling
This commit is contained in:
@@ -284,16 +284,19 @@ namespace OpenVulkano
|
||||
if (SkipTill(std::filesystem::file_type::regular))
|
||||
{
|
||||
FileDescription fileDescription = GetNextDescription();
|
||||
std::string outputFilePath;
|
||||
std::filesystem::path outputFilePath;
|
||||
if (m_filePathRewrite)
|
||||
outputFilePath = (targetDir / m_filePathRewrite(fileDescription.path)).string();
|
||||
outputFilePath = targetDir / m_filePathRewrite(fileDescription.path);
|
||||
else
|
||||
outputFilePath = (targetDir / fileDescription.path).string();
|
||||
outputFilePath = targetDir / static_cast<const std::string&>(fileDescription.path);
|
||||
|
||||
const std::unique_ptr<archive, decltype(archive_write_free)*> a(archive_write_disk_new(), archive_write_free);
|
||||
const std::unique_ptr<archive_entry, decltype(archive_entry_free)*> entry(archive_entry_clone(m_archiveEntry), archive_entry_free);
|
||||
|
||||
archive_entry_set_pathname(entry.get(), outputFilePath.c_str());
|
||||
if constexpr (std::is_same_v<std::filesystem::path::value_type, char>)
|
||||
archive_entry_set_pathname(entry.get(), (const char*)outputFilePath.c_str());
|
||||
else
|
||||
archive_entry_copy_pathname_w(entry.get(), (const wchar_t*)outputFilePath.c_str());
|
||||
|
||||
ChkErr(archive_write_disk_set_options(a.get(), ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | ARCHIVE_EXTRACT_FFLAGS));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user