mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove Platform.HasSingleRootFilesystem query
This commit is contained in:
@@ -217,18 +217,12 @@ namespace System.Management.Automation
|
||||
|
||||
}
|
||||
|
||||
// Linux has a single rooted file system
|
||||
internal static bool HasSingleRootFilesystem()
|
||||
{
|
||||
return !IsWindows;
|
||||
}
|
||||
|
||||
// Linux has no notion of file shares. It has mount points
|
||||
// instead, which are subdirectories of its single-root
|
||||
// filesystem.
|
||||
internal static bool HasFileShares()
|
||||
{
|
||||
return !HasSingleRootFilesystem();
|
||||
return IsWindows();
|
||||
}
|
||||
|
||||
// Linux has no support for UNC, just mounts in a single rooted hierarchy
|
||||
|
||||
@@ -947,12 +947,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
root = newDrive.RootDirectory.FullName;
|
||||
}
|
||||
|
||||
#if LINUX
|
||||
// Porting notes: On platforms with single root filesystems, only
|
||||
// add the filesystem with the root "/" to the initial drive list,
|
||||
// otherwise path handling will not work correctly because there
|
||||
// is no : available to separate the filesystems from each other
|
||||
if (Platform.HasSingleRootFilesystem() && root != StringLiterals.DefaultPathSeparatorString)
|
||||
if (root != StringLiterals.DefaultPathSeparatorString)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
// Porting notes: On non-windows platforms .net can report two
|
||||
// drives with the same root, make sure to only add one of those
|
||||
|
||||
@@ -1589,9 +1589,12 @@ namespace System.Management.Automation
|
||||
/// </returns>
|
||||
internal static bool IsSingleFileSystemAbsolutePath(string path)
|
||||
{
|
||||
return Platform.HasSingleRootFilesystem() &&
|
||||
(path.StartsWith(StringLiterals.DefaultPathSeparatorString, StringComparison.Ordinal) ||
|
||||
path.StartsWith(StringLiterals.AlternatePathSeparatorString, StringComparison.Ordinal));
|
||||
#if LINUX
|
||||
return path.StartsWith(StringLiterals.DefaultPathSeparatorString, StringComparison.Ordinal)
|
||||
|| path.StartsWith(StringLiterals.AlternatePathSeparatorString, StringComparison.Ordinal);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
} // IsSingleFileSystemAbsolutePath
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user