From 049de14090ffc5103d6beb52ef6d108634411ac4 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 1 Dec 2023 06:55:16 +0000 Subject: [PATCH] [*] Ooops: acd8f6cf --- Source/IO/FS/FS.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Source/IO/FS/FS.cpp b/Source/IO/FS/FS.cpp index c21ec2bf..c233f67f 100644 --- a/Source/IO/FS/FS.cpp +++ b/Source/IO/FS/FS.cpp @@ -506,15 +506,31 @@ namespace Aurora::IO::FS for (const auto &[rawPath, rawPathDest] : now) { + auto rawPathA = NormalizePathRet(rawPath); + + if (rawPathA.empty()) + { + out->errorCopyPaths.push_back(rawPath); + continue; + } + #if defined(AURORA_PLATFORM_WIN32) { - auto winLinkA = AuLocale::ConvertFromUTF8(rawPath); - auto winLinkB = AuLocale::ConvertFromUTF8(rawPathDest); - if (::MoveFileExW(winLinkA.c_str(), winLinkB.c_str(), MOVEFILE_WRITE_THROUGH)) + auto winLinkA = AuLocale::ConvertFromUTF8(rawPathA); + auto winLinkB = AuLocale::ConvertFromUTF8(NormalizePathRet(rawPathDest)); + + if (winLinkA.empty() || + winLinkB.empty()) { out->errorCopyPaths.push_back(rawPath); continue; } + + if (::MoveFileExW(winLinkA.c_str(), winLinkB.c_str(), MOVEFILE_WRITE_THROUGH)) + { + out->copyPathsSuccess.push_back(rawPath); + continue; + } } #endif AuList files;