Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfister <steve.pfister@microsoft.com>2019-07-03 15:35:52 +0300
committerSteve Pfister <steve.pfister@microsoft.com>2019-07-03 15:45:50 +0300
commitee6bf0c4ec3acd7d7852758091a8b8e3b651c56a (patch)
tree166e04a343e292d7e06aad736a8523ad920064ae
parentf1bfb2bbdb7a205e2fc8664da5c676cdd2e1a191 (diff)
Fix the fsw check for just spaces in a file name
-rw-r--r--src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs11
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