mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
cmake-server: Do not try watching subdirectories with empty names
`cmsys::SystemTools::SplitPath` will return empty segments on paths where there's duplicaded consequent slashes (e.g. `/home/dir/my//stuff`). This makes the cmFileWatcher choke. Teach cmFileMonitor to skip these empty segments. Closes: #16531
This commit is contained in:
@@ -331,6 +331,9 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& 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) {
|
||||
|
||||
Reference in New Issue
Block a user