Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: runtime/bin/file_system_watcher_macos.cc

Issue 39773002: Fix issue where we would double unwatch the path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698