summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-15 15:48:13 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-15 15:48:13 (GMT)
commit4966c8d8dabfb8e1077d69137f32031fa38a9ae5 (patch)
tree31d9bd0c64759145efa4816e65fa6858ccc9c867 /Source/kwsys
parentf67f76c2b3a4c50d4116ce806df0c7f861e227dd (diff)
parent86399e49398cc9e8028e280eee3e89992ab3fd11 (diff)
downloadCMake-4966c8d8dabfb8e1077d69137f32031fa38a9ae5.zip
CMake-4966c8d8dabfb8e1077d69137f32031fa38a9ae5.tar.gz
CMake-4966c8d8dabfb8e1077d69137f32031fa38a9ae5.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2017-12-15 (8f755ee9)
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 649f30b..f547362 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -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;