Index: runtime/bin/file_system_watcher_macos.cc |
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc |
index 1ae1810f65d2355a182c4dcfaacef4a5f9eeda18..4aed2e37f9d7b0ccd744b5dfb110a7bb9bfdb577 100644 |
--- a/runtime/bin/file_system_watcher_macos.cc |
+++ b/runtime/bin/file_system_watcher_macos.cc |
@@ -201,7 +201,9 @@ class FSEventsWatcher { |
Node* node = reinterpret_cast<Node*>(client); |
for (size_t i = 0; i < num_events; i++) { |
char *path = reinterpret_cast<char**>(event_paths)[i]; |
- path += node->base_path_length() + 1; |
+ path += node->base_path_length(); |
+ // If path is longer the base, skip next character ('/'). |
+ if (path[0] != '\0') path += 1; |
if (!node->recursive() && strstr(path, "/") != NULL) continue; |
FSEvent event; |
event.data.flags = event_flags[i]; |