mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-16 12:11:04 -06:00
Merge topic 'update-kwsys'
4966c8d8Merge branch 'upstream-KWSys' into update-kwsys86399e49KWSys 2017-12-15 (8f755ee9) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1597
This commit is contained in:
@@ -2509,6 +2509,14 @@ bool SystemTools::RemoveFile(const std::string& source)
|
||||
if (IsJunction(ws) && DeleteJunction(ws)) {
|
||||
return true;
|
||||
}
|
||||
const DWORD DIRECTORY_SOFT_LINK_ATTRS =
|
||||
FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
DWORD attrs = GetFileAttributesW(ws.c_str());
|
||||
if (attrs != INVALID_FILE_ATTRIBUTES &&
|
||||
(attrs & DIRECTORY_SOFT_LINK_ATTRS) == DIRECTORY_SOFT_LINK_ATTRS &&
|
||||
RemoveDirectoryW(ws.c_str())) {
|
||||
return true;
|
||||
}
|
||||
if (DeleteFileW(ws.c_str()) || GetLastError() == ERROR_FILE_NOT_FOUND ||
|
||||
GetLastError() == ERROR_PATH_NOT_FOUND) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user