Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2243,13 +2243,12 @@ int FileCopy(const char *srcPath, const char *dstPath)
int srcDataSize = 0;
unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize);

// Create required paths if they do not exist
if (DirectoryExists(GetDirectoryPath(dstPath))) result = 0; // Already exists
else result = MakeDirectory(GetDirectoryPath(dstPath));

if (result == 0) // Directory created successfully or already exists
if ((srcFileData != NULL) && (srcDataSize > 0))
{
if ((srcFileData != NULL) && (srcDataSize > 0))
// Create required paths if they do not exist
const char *dstDirPath = GetDirectoryPath(dstPath);

if (DirectoryExists(dstDirPath) || (MakeDirectory(dstDirPath) == 0)) // Directory created successfully or already exists
{
bool saved = SaveFileData(dstPath, srcFileData, srcDataSize);
if (saved) result = 0;
Expand Down
Loading