Skip to content

Commit

Permalink
[Mac] Remove trailing '/' from folder path in fs events returned by s…
Browse files Browse the repository at this point in the history
…ystem.
  • Loading branch information
killing committed Dec 15, 2014
1 parent 1856423 commit ec669e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions daemon/wt-monitor-macos.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ process_one_event (const char* eventPath,
filename = g_strdup(tmp);
g_free (event_path_nfc);

/* Path for folder returned from system may contain a '/' at the end. */
int len = strlen(filename);
if (len > 0 && filename[len - 1] == '/')
filename[len - 1] = 0;

/* Reinterpreted RENAMED as combine of CREATED or DELETED event */
if (eventFlags & kFSEventStreamEventFlagItemRenamed) {
seaf_debug ("Rename Event Affected: %s \n", filename);
Expand Down

0 comments on commit ec669e1

Please sign in to comment.