From f6867bb725d057ae1458699a71f4aa5c7b5c4d9b Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Mon, 28 Mar 2016 12:08:48 -0400
Subject: [PATCH] SystemTools: flip junction deletion around

If the path is a junction, pass if the junction was successfully
deleted. Not doing so triggers an INVALID_FILE_HANDLE error when
DeleteFileW is called later, not that the path doesn't exist.

Change-Id: I8957a0ca0704f7f950faeac90b15e8c61c5f5a90
---
 SystemTools.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 0c7f419..24f70d1 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2884,9 +2884,9 @@ bool SystemTools::RemoveFile(const std::string& source)
     SetLastError(err);
     return false;
     }
-  if (IsJunction(ws) && !DeleteJunction(ws))
+  if (IsJunction(ws) && DeleteJunction(ws))
     {
-    return false;
+    return true;
     }
   if (DeleteFileW(ws.c_str()) ||
       GetLastError() == ERROR_FILE_NOT_FOUND ||
-- 
GitLab