From bf639a2c4a98c9e050cbc8bad1900a01fe66c496 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Thu, 1 Jun 2023 17:10:36 +0300 Subject: [PATCH] Fix copying files on case-sensitive file systems Closes #273 --- src/file_utils.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/file_utils.cc b/src/file_utils.cc index 3c47e5b..8d3ebc1 100644 --- a/src/file_utils.cc +++ b/src/file_utils.cc @@ -150,16 +150,8 @@ int _gzdecompress_file(const char* existingFilePath, const char* newFilePath) static void fileCopy(const char* existingFilePath, const char* newFilePath) { - char nativeExistingFilePath[COMPAT_MAX_PATH]; - strcpy(nativeExistingFilePath, existingFilePath); - compat_windows_path_to_native(nativeExistingFilePath); - - char nativeNewFilePath[COMPAT_MAX_PATH]; - strcpy(nativeNewFilePath, newFilePath); - compat_windows_path_to_native(nativeNewFilePath); - - FILE* in = fopen(nativeExistingFilePath, "rb"); - FILE* out = fopen(nativeNewFilePath, "wb"); + FILE* in = compat_fopen(existingFilePath, "rb"); + FILE* out = compat_fopen(newFilePath, "wb"); if (in != NULL && out != NULL) { std::vector buffer(0xFFFF);