diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index ea37683bb..815de95e7 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -331,6 +331,9 @@ void cmFileMonitor::MonitorPaths(const std::vector& paths, rootSegment)); // Can not be both filename and root part of the path! const std::string& currentSegment = pathSegments[i]; + if (currentSegment.empty()) { + continue; + } cmIBaseWatcher* nextWatcher = currentWatcher->Find(currentSegment); if (!nextWatcher) {