diff --git a/src/Zio/FileSystems/PhysicalFileSystem.cs b/src/Zio/FileSystems/PhysicalFileSystem.cs index 494fd75..8d4fb87 100644 --- a/src/Zio/FileSystems/PhysicalFileSystem.cs +++ b/src/Zio/FileSystems/PhysicalFileSystem.cs @@ -970,7 +970,10 @@ protected override string ConvertPathToInternalImpl(UPath path) private static bool HasWindowsVolumeLabel(string path) { - return path.IndexOf(":\\", StringComparison.Ordinal) == 1; + if (!IsOnWindows) + throw new NotSupportedException($"{nameof(HasWindowsVolumeLabel)} is only supported on Windows platforms."); + + return path.Length >= 3 && path[1] == ':' && path[2] is '\\' or '/'; } ///