diff options
author | Steve Pfister <steveisok@users.noreply.github.com> | 2019-07-03 16:21:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 16:21:46 +0300 |
commit | 9354dfd8d3cd4af62592bee9d8fe434e5694788a (patch) | |
tree | 24c543ab15e246c7edfbf354b2602641ea9c283f | |
parent | f1bfb2bbdb7a205e2fc8664da5c676cdd2e1a191 (diff) | |
parent | d49af938df1dabbedd05614d03b1cf9904b623dc (diff) |
Merge pull request #308 from steveisok/pathinternal-tweak
Fix the fsw check for just spaces in a file name
-rw-r--r-- | src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs b/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs index 45df8be254..e7affc5201 100644 --- a/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs +++ b/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs @@ -391,26 +391,13 @@ namespace System.IO throw new ArgumentException(SR.Format(SR.InvalidDirName_NotExists, path), nameof(path)); } -#if MONO - /// <summary> - /// Returns true if the path is effectively empty for the current OS. - /// This function is borrowed from PathInternal.Windows because Mono - /// on the desktop still needs to support the netfx behavior. - /// EffectivelyEmpty means an empty span, null, or just spaces ((char)32). - /// </summary> - private static bool IsEffectivelyEmpty(ReadOnlySpan<char> path) - { - return (path.IsEmpty || path.IndexOf(' ') > -1); - } -#endif - /// <summary> /// Sees if the name given matches the name filter we have. /// </summary> private bool MatchPattern(ReadOnlySpan<char> relativePath) { #if MONO - if (IsEffectivelyEmpty (relativePath)) + if (relativePath.IsWhiteSpace()) return false; #endif ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath); |