diff --git a/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp b/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp index e54d36e..186537f 100644 --- a/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp +++ b/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp @@ -80,15 +80,19 @@ namespace OpenVulkano bool AddFiles(const std::filesystem::path& dirName, const std::string& inArchiveDirName) { - std::string sDirName = dirName.string(); - AddFile(sDirName.c_str(), inArchiveDirName.c_str()); + const std::string sDirName = dirName.string(); + const std::string prefix = inArchiveDirName.empty() ? "" : inArchiveDirName + "/"; + if (!inArchiveDirName.empty()) + { + AddFile(sDirName.c_str(), inArchiveDirName.c_str()); + } for(const auto& entry : std::filesystem::directory_iterator(dirName)) { - std::string fPath = inArchiveDirName + "/" + entry.path().filename().string(); + const std::string fPath = prefix + entry.path().filename().string(); if (entry.is_directory()) AddFiles(entry, fPath); else { - std::string entryName = entry.path().string(); + const std::string entryName = entry.path().string(); AddFile(entryName.c_str(), fPath.c_str()); } }