2
0
Эх сурвалжийг харах

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

rich2014 2 сар өмнө
parent
commit
9df79dc94a

+ 4 - 1
src/platform/unix/darwin/udarwinfswatch.pas

@@ -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;