diff options
author | Brad King <brad.king@kitware.com> | 2018-11-01 13:02:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-11-01 13:02:30 (GMT) |
commit | 4ccf278f5bc9815f76f393948c09f82092e9f1ec (patch) | |
tree | e000ebc28efa447f2613d92bdc0dee59756a3e82 | |
parent | 609bdd126d56f81cbf59bacd6931cf8a53c36229 (diff) | |
parent | eb52529ff41d375344c2bd45a717bf86669627f8 (diff) | |
download | CMake-4ccf278f5bc9815f76f393948c09f82092e9f1ec.zip CMake-4ccf278f5bc9815f76f393948c09f82092e9f1ec.tar.gz CMake-4ccf278f5bc9815f76f393948c09f82092e9f1ec.tar.bz2 |
Merge branch 'server-file-monitor-check' into release-3.12
Merge-request: !2556
-rw-r--r-- | Source/cmFileMonitor.cxx | 3 |
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 && |