diff options
author | Steve Pfister <steve.pfister@microsoft.com> | 2019-07-03 15:35:52 +0300 |
---|---|---|
committer | Steve Pfister <steve.pfister@microsoft.com> | 2019-07-03 15:45:50 +0300 |
commit | ee6bf0c4ec3acd7d7852758091a8b8e3b651c56a (patch) | |
tree | 166e04a343e292d7e06aad736a8523ad920064ae | |
parent | f1bfb2bbdb7a205e2fc8664da5c676cdd2e1a191 (diff) |
Fix the fsw check for just spaces in a file name
-rw-r--r-- | src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs | 11 |
1 files changed, 10 insertions, 1 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..a10cbf67aa 100644 --- a/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs +++ b/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs @@ -400,7 +400,16 @@ namespace System.IO /// </summary> private static bool IsEffectivelyEmpty(ReadOnlySpan<char> path) { - return (path.IsEmpty || path.IndexOf(' ') > -1); + if (path.IsEmpty) + return true; + + foreach (char c in path) + { + if (c != ' ') + return false; + } + + return true; } #endif |