From 850cc3a28de77bc18894474257b946b3daeca307 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Sat, 10 Aug 2019 10:17:58 -0400 Subject: [PATCH] Fix another bug in https://github.com/mono/mono/pull/16049 (#330) --- .../src/System/IO/FileSystemWatcher.OSX.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.OSX.cs b/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.OSX.cs index f451ab60e87d..af543fc6fdca 100644 --- a/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.OSX.cs +++ b/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.OSX.cs @@ -483,7 +483,7 @@ private unsafe void ProcessEvents(int numEvents, // Remove the base directory prefix and add the paired event to the list of // events to skip and notify the user of the rename if (events[pairedId].Span.Length >= _fullDirectory.Length - && ((ReadOnlySpan) events[pairedId].Span).Equals(_fullDirectory.AsSpan(0, events[pairedId].Span.Length), StringComparison.OrdinalIgnoreCase)) + && _fullDirectory.AsSpan().Equals(events[pairedId].Span.Slice(0, _fullDirectory.Length), StringComparison.OrdinalIgnoreCase) { ReadOnlySpan newPathRelativeName = events[pairedId].Span.Slice(_fullDirectory.Length); watcher.NotifyRenameEventArgs(WatcherChangeTypes.Renamed, newPathRelativeName, relativePath);