summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-16 20:39:49 +0200
committerAki <please@ignore.pl>2022-09-16 20:39:49 +0200
commit61346f1c01322eb152b219743b026c504abcb8d1 (patch)
tree29a6527250a617405d63ecb04ebd7cb7cb7368cb
parent37c420447357dc0180bdc67e4ed7ff69db9f5b31 (diff)
downloadstarshatter-61346f1c01322eb152b219743b026c504abcb8d1.zip
starshatter-61346f1c01322eb152b219743b026c504abcb8d1.tar.gz
starshatter-61346f1c01322eb152b219743b026c504abcb8d1.tar.bz2
Fixed archive entry path on WIN32
-rw-r--r--ArchiveEx/Archive.cpp4
1 files changed, 3 insertions, 1 deletions
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<char[]>(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;