Piotr Czajkowski 8 годин тому
батько
коміт
a46fd8a252
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      ProcessFiles/ProcessFiles.cs

+ 6 - 1
ProcessFiles/ProcessFiles.cs

@@ -16,7 +16,12 @@ namespace ProcessFiles
     {
         private List<string> errors = [];
         
-        private static readonly char[] invalidCharactersForExtension = ['"', '<', '>', ':', '|', '?', '*'];
+        private static readonly char[] invalidCharactersForExtension =
+            [.. ExtraChars(), .. Enumerable.Range(0x00, 0x20).Select(i => (char)i)];
+
+        private static IEnumerable<char> ExtraChars() => ['"', '<', '>', ':', '|', '?', '*',
+            '\\', '/'];
+        
         public static char[] InvalidCharactersForExtension => [.. invalidCharactersForExtension];
         
         private Result WhatIsIt(string path)