mirror of
https://github.com/raysan5/raylib.git
synced 2026-07-13 12:40:35 +00:00
[rcore] Fix `FileCopy` doesn't copy file when directory exists (#5920)
* Fix FileCopy result * fix code style
This commit is contained in:
@@ -2237,8 +2237,14 @@ 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)))
|
||||
if (DirectoryExists(GetDirectoryPath(dstPath)))
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = MakeDirectory(GetDirectoryPath(dstPath));
|
||||
}
|
||||
|
||||
if (result == 0) // Directory created successfully (or already exists)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user