mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix Split-Path -NoQualifier for Unix paths
This commit is contained in:
+6
-3
@@ -553,9 +553,12 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (SessionState.Path.IsPSAbsolute(path, out driveName))
|
||||
{
|
||||
// Remove the drive name and colon
|
||||
|
||||
result = path.Substring(driveName.Length + 1);
|
||||
var driveNameLength = driveName.Length;
|
||||
if (path.Length > (driveNameLength + 1) && path[driveNameLength] == ':')
|
||||
{
|
||||
// Remove the drive name and colon
|
||||
result = path.Substring(driveNameLength + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user