KWSys 2025-11-12 (1139f8a0)

Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 1139f8a044044860e9a4c3b964750cbe68fe3f6d (master).

Upstream Shortlog
-----------------

Brad King (2):
      abb5ca15 SystemTools: Fix CopyFileIfNewer error status when source is missing
      001e388f Directory: Restore Load() error for missing directory on Windows
This commit is contained in:
KWSys Upstream
2025-11-12 11:40:18 -05:00
committed by Brad King
parent fc7ef5028a
commit dc8cc945ee
2 changed files with 3 additions and 3 deletions

View File

@@ -184,7 +184,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
delete[] buf;
if (srchHandle == INVALID_HANDLE_VALUE) {
Status status = Status::POSIX_errno();
Status status = Status::Windows_GetLastError();
if (errorMessage) {
*errorMessage = status.GetString();
}
@@ -198,7 +198,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
} while (FindNextFileW(srchHandle, &data));
this->Internal->Path = name;
if (!FindClose(srchHandle)) {
Status status = Status::POSIX_errno();
Status status = Status::Windows_GetLastError();
if (errorMessage) {
*errorMessage = status.GetString();
}

View File

@@ -2273,7 +2273,7 @@ SystemTools::CopyStatus SystemTools::CopyFileIfNewer(
// source and destination are files so do a copy if source is newer
// Check if source file exists first
if (!SystemTools::FileExists(source)) {
return CopyStatus{ Status::POSIX_errno(), CopyStatus::SourcePath };
return CopyStatus{ Status::POSIX(ENOENT), CopyStatus::SourcePath };
}
// If destination doesn't exist, always copy
if (!SystemTools::FileExists(destination)) {