Skip to content

Commit 502a411

Browse files
authored
Moved handling to A: and B: drives under unknown case (#3211)
1 parent 8d3da79 commit 502a411

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Files/Filesystem/Drives.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,7 @@ private DriveType GetDriveType(DriveInfo drive)
317317
break;
318318

319319
case System.IO.DriveType.Fixed:
320-
if (Helpers.PathNormalization.NormalizePath(drive.Name) != Helpers.PathNormalization.NormalizePath("A:")
321-
&& Helpers.PathNormalization.NormalizePath(drive.Name) !=
322-
Helpers.PathNormalization.NormalizePath("B:"))
323-
{
324-
type = DriveType.Fixed;
325-
}
326-
else
327-
{
328-
type = DriveType.FloppyDisk;
329-
}
320+
type = DriveType.Fixed;
330321
break;
331322

332323
case System.IO.DriveType.Network:
@@ -346,7 +337,15 @@ private DriveType GetDriveType(DriveInfo drive)
346337
break;
347338

348339
case System.IO.DriveType.Unknown:
349-
type = DriveType.Unknown;
340+
if (Helpers.PathNormalization.NormalizePath(drive.Name) != Helpers.PathNormalization.NormalizePath("A:") &&
341+
Helpers.PathNormalization.NormalizePath(drive.Name) != Helpers.PathNormalization.NormalizePath("B:"))
342+
{
343+
type = DriveType.Unknown;
344+
}
345+
else
346+
{
347+
type = DriveType.FloppyDisk;
348+
}
350349
break;
351350

352351
default:

0 commit comments

Comments
 (0)