fixed: for deleting files and folders on Windows we have to call the Unicode variants of these functions.

This commit is contained in:
Christoph Oelckers 2024-05-01 09:47:58 +02:00
commit 81dade9ed5
6 changed files with 32 additions and 16 deletions

View file

@ -40,6 +40,7 @@
#include "m_swap.h"
#include "w_zip.h"
#include "fs_decompress.h"
#include "cmdlib.h"
using FileSys::FCompressedBuffer;
@ -201,7 +202,7 @@ bool WriteZip(const char* filename, const FCompressedBuffer* content, size_t con
if (pos == -1)
{
delete f;
remove(filename);
RemoveFile(filename);
return false;
}
positions.Push(pos);
@ -213,7 +214,7 @@ bool WriteZip(const char* filename, const FCompressedBuffer* content, size_t con
if (AppendCentralDirectory(f, content[i], dostime, positions[i]) < 0)
{
delete f;
remove(filename);
RemoveFile(filename);
return false;
}
}
@ -230,7 +231,7 @@ bool WriteZip(const char* filename, const FCompressedBuffer* content, size_t con
if (f->Write(&dirend, sizeof(dirend)) != sizeof(dirend))
{
delete f;
remove(filename);
RemoveFile(filename);
return false;
}
delete f;