From 11d846b8ff84e9a669f5d3bb49dcbfb05574330c Mon Sep 17 00:00:00 2001
From: KWSys Upstream <kwrobot@kitware.com>
Date: Thu, 9 Apr 2020 07:30:05 -0400
Subject: [PATCH] KWSys 2020-04-09 (e798e567)

Code extracted from:

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

at commit e798e567760aaa6b87c31035c3f74622ecdcb5b2 (master).

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

Brad King (1):
      41700ca4 SystemTools: Fix FileIsExecutable on Windows
---
 SystemTools.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 880b2d2c3d..8ec3058097 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -3010,7 +3010,11 @@ bool SystemTools::FileIsDirectory(const std::string& inName)
 
 bool SystemTools::FileIsExecutable(const std::string& name)
 {
+#if defined(_WIN32)
+  return SystemTools::FileExists(name, true);
+#else
   return !FileIsDirectory(name) && TestFileAccess(name, TEST_FILE_EXECUTE);
+#endif
 }
 
 bool SystemTools::FileIsSymlink(const std::string& name)
-- 
GitLab