WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 9aad7cc

Browse files
committed
GetLastError() doesn't return anything if the call succeeds
1 parent 3f8118c commit 9aad7cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/FileManager/FileOperations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ enum _FileOperations {
618618
try destination.withNTPathRepresentation { pwszDestination in
619619
var faDestinationAttributes: WIN32_FILE_ATTRIBUTE_DATA = .init()
620620
if GetFileAttributesExW(pwszDestination, GetFileExInfoStandard, &faDestinationAttributes) {
621-
let error = CocoaError.moveFileError(GetLastError(), src, dst)
621+
let error = CocoaError.moveFileError(ERROR_ALREADY_EXISTS, src, dst)
622622
guard fileManager._shouldProceedAfter(error: error, movingItemAtPath: source, to: destination) else {
623623
throw error
624624
}

0 commit comments

Comments
 (0)