summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-02 11:48:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-02 11:48:34 (GMT)
commitc384fc3ca4e4523efa7330d7684f5cf3de672826 (patch)
tree58a4405a8a3a5fd13c799fdbbb4f58649b3e3fec
parentfa5e5550f3f19842590b2d9e19b3c3e3c1132e02 (diff)
parenteb52529ff41d375344c2bd45a717bf86669627f8 (diff)
downloadCMake-c384fc3ca4e4523efa7330d7684f5cf3de672826.zip
CMake-c384fc3ca4e4523efa7330d7684f5cf3de672826.tar.gz
CMake-c384fc3ca4e4523efa7330d7684f5cf3de672826.tar.bz2
Merge topic 'server-file-monitor-check'
eb52529ff4 server: Fix assertion failure on directory paths in file monitor Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2556
-rw-r--r--Source/cmFileMonitor.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index 04a3c0e..b36ac78 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -315,6 +315,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
for (std::string const& p : paths) {
std::vector<std::string> pathSegments;
cmsys::SystemTools::SplitPath(p, pathSegments, true);
+ const bool pathIsFile = !cmsys::SystemTools::FileIsDirectory(p);
const size_t segmentCount = pathSegments.size();
if (segmentCount < 2) { // Expect at least rootdir and filename
@@ -324,7 +325,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
for (size_t i = 0; i < segmentCount; ++i) {
assert(currentWatcher);
- const bool fileSegment = (i == segmentCount - 1);
+ const bool fileSegment = (i == segmentCount - 1 && pathIsFile);
const bool rootSegment = (i == 0);
assert(
!(fileSegment &&