2 Commits

Author SHA1 Message Date
Ray
8713741782 Update rcore.c 2026-06-13 09:21:39 +02:00
ac6526b731 [rcore] Fix `FileCopy` doesn't copy file when directory exists (#5920)
* Fix FileCopy result

* fix code style
2026-06-13 09:18:41 +02:00

View File

@ -2237,10 +2237,10 @@ int FileCopy(const char *srcPath, const char *dstPath)
unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize);
// Create required paths if they do not exist
if (!DirectoryExists(GetDirectoryPath(dstPath)))
result = MakeDirectory(GetDirectoryPath(dstPath));
if (DirectoryExists(GetDirectoryPath(dstPath))) result = 0; // Already exists
else result = MakeDirectory(GetDirectoryPath(dstPath));
if (result == 0) // Directory created successfully (or already exists)
if (result == 0) // Directory created successfully or already exists
{
if ((srcFileData != NULL) && (srcDataSize > 0))
{