# HG changeset patch # User Olivier Scherler # Date 1242131910 -7200 # Node ID 2befbe36c746641c7a7c30f9e8531fb3d6cfcb3b # Parent 8874aff14cc9ee287832aa9723e7b55c5fa9e910 Changed -[MYDirectoryEvent relativePath] to work on standardised paths, in case symlinks are used. Fixes issue #28 in Murky. diff -r 8874aff14cc9 -r 2befbe36c746 MYDirectoryWatcher.m --- a/MYDirectoryWatcher.m Sun May 10 18:57:43 2009 -0700 +++ b/MYDirectoryWatcher.m Tue May 12 14:38:30 2009 +0200 @@ -191,13 +191,14 @@ - (NSString*) relativePath { - NSString *base = watcher.path; - if( ! [path hasPrefix: base] ) + NSString *base = [watcher.path stringByStandardizingPath]; + NSString *standardizedPath = [path stringByStandardizingPath]; + if( ! [standardizedPath hasPrefix: base] ) return nil; unsigned length = base.length; - while( length < path.length && [path characterAtIndex: length]=='/' ) + while( length < standardizedPath.length && [standardizedPath characterAtIndex: length]=='/' ) length++; - return [path substringFromIndex: length]; + return [standardizedPath substringFromIndex: length]; } - (BOOL) mustScanSubdirectories {return (flags & kFSEventStreamEventFlagMustScanSubDirs) != 0;}