From 58dd40bf3e0cb29250dc5f53a233e76f98bfe2b1 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 29 Dec 2025 20:11:05 +0200 Subject: [PATCH] Refactor last commit --- .../Utils/Extensions/PathExtensions.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/DiscordChatExporter.Core/Utils/Extensions/PathExtensions.cs b/DiscordChatExporter.Core/Utils/Extensions/PathExtensions.cs index 4ae267fe..183fc13c 100644 --- a/DiscordChatExporter.Core/Utils/Extensions/PathExtensions.cs +++ b/DiscordChatExporter.Core/Utils/Extensions/PathExtensions.cs @@ -1,22 +1,20 @@ using System; using System.IO; -using System.Linq; using System.Text; namespace DiscordChatExporter.Core.Utils.Extensions; public static class PathExtensions { - // Characters that are invalid on common filesystems. // This is a union of invalid characters from Windows (NTFS/FAT32), Linux (ext4/XFS), and macOS (HFS+/APFS). // We use this instead of Path.GetInvalidFileNameChars() because that only returns OS-specific characters, - // not filesystem-specific characters. This means that it's possible to use, for example, an NTFS drive on - // Linux, which would allow the OS to create filenames with '?' but result in errors when writing to the filesystem. + // not filesystem-specific characters. It's possible to use, for example, an NTFS drive on Linux, + // which would make some additional characters invalid that are otherwise valid on Linux. // https://github.com/Tyrrrz/DiscordChatExporter/issues/1452 private static readonly char[] InvalidFileNameChars = [ '\0', // Null character - invalid on all filesystems - '/', // Path separator on Unix + '/', // Path separator on Unix and Windows '\\', // Path separator on Windows ':', // Reserved on Windows (drive letters, NTFS streams) '*', // Wildcard on Windows