From ec669e18f9d518219c0aff76b4fbd92ccf45006b Mon Sep 17 00:00:00 2001 From: Jiaqiang Xu Date: Mon, 15 Dec 2014 12:07:45 +0800 Subject: [PATCH] [Mac] Remove trailing '/' from folder path in fs events returned by system. --- daemon/wt-monitor-macos.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/daemon/wt-monitor-macos.c b/daemon/wt-monitor-macos.c index 6a23b07f3..d24c81bc9 100644 --- a/daemon/wt-monitor-macos.c +++ b/daemon/wt-monitor-macos.c @@ -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);