From 61346f1c01322eb152b219743b026c504abcb8d1 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 16 Sep 2022 20:39:49 +0200 Subject: Fixed archive entry path on WIN32 --- ArchiveEx/Archive.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ArchiveEx/Archive.cpp b/ArchiveEx/Archive.cpp index c6e4e97..ad29c92 100644 --- a/ArchiveEx/Archive.cpp +++ b/ArchiveEx/Archive.cpp @@ -186,7 +186,9 @@ Archive::Insert(const char* filepath) blocks.resize(destination_block + total_blocks, UNUSED_BLOCK); for (std::size_t i = destination_block; i < destination_block + total_blocks; ++i) blocks[i] = index; - std::strcpy(entries[index].name, filepath); + auto normalized_path = std::make_unique(std::strlen(filepath) + 1); + ConvertPathSeparator(filepath, normalized_path.get()); + std::strcpy(entries[index].name, normalized_path.get()); entries[index].original_size = uncompressed_size; entries[index].compressed_size = compressed_size; entries[index].offset = destination_block * BLOCK_SIZE; -- cgit v1.1