Fix copying files on case-sensitive file systems

Closes #273
This commit is contained in:
Alexander Batalov 2023-06-01 17:10:36 +03:00
parent 89839be3af
commit bf639a2c4a
1 changed files with 2 additions and 10 deletions

View File

@ -150,16 +150,8 @@ int _gzdecompress_file(const char* existingFilePath, const char* newFilePath)
static void fileCopy(const char* existingFilePath, const char* newFilePath) static void fileCopy(const char* existingFilePath, const char* newFilePath)
{ {
char nativeExistingFilePath[COMPAT_MAX_PATH]; FILE* in = compat_fopen(existingFilePath, "rb");
strcpy(nativeExistingFilePath, existingFilePath); FILE* out = compat_fopen(newFilePath, "wb");
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");
if (in != NULL && out != NULL) { if (in != NULL && out != NULL) {
std::vector<unsigned char> buffer(0xFFFF); std::vector<unsigned char> buffer(0xFFFF);