FIX: udarwinfswatch: the issue that when monitoring the root directory, changes in the second-level directory were also matched

This commit is contained in:
rich2014 2025-06-27 21:27:09 +08:00
commit 9df79dc94a

View file

@ -357,7 +357,10 @@ begin
// not watchSubtree, and startsWith watchPath
// detect if fullPath and watchPath in the same level
fullPathDeep:= fullPath.CountChar(PathDelim);
watchPathDeep:= watchPath.CountChar(PathDelim)+1;
if watchPath = PathDelim then
watchPathDeep:= 1
else
watchPathDeep:= watchPath.CountChar(PathDelim)+1;
Result:= fullPathDeep=watchPathDeep;
end;