@@ -10,26 +10,6 @@ namespace Microsoft.PowerShell.EditorServices.Utility
10
10
{
11
11
internal static class PathUtils
12
12
{
13
- /// <summary>
14
- /// <para>The default path separator used by the base implementation of the providers.</para>
15
- /// <para>
16
- /// Porting note: IO.Path.DirectorySeparatorChar is correct for all platforms. On Windows,
17
- /// it is '\', and on Linux, it is '/', as expected.
18
- /// </para>
19
- /// </summary>
20
- internal static readonly char DefaultPathSeparator = Path . DirectorySeparatorChar ;
21
-
22
- /// <summary>
23
- /// <para>The alternate path separator used by the base implementation of the providers.</para>
24
- /// <para>
25
- /// Porting note: we do not use .NET's AlternatePathSeparatorChar here because it correctly
26
- /// states that both the default and alternate are '/' on Linux. However, for PowerShell to
27
- /// be "slash agnostic", we need to use the assumption that a '\' is the alternate path
28
- /// separator on Linux.
29
- /// </para>
30
- /// </summary>
31
- internal static readonly char AlternatePathSeparator = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? '/' : '\\ ' ;
32
-
33
13
/// <summary>
34
14
/// The <see cref="StringComparison" /> value to be used when comparing paths. Will be
35
15
/// <see cref="StringComparison.Ordinal" /> for case sensitive file systems and <see cref="StringComparison.OrdinalIgnoreCase" />
@@ -39,13 +19,6 @@ internal static class PathUtils
39
19
? StringComparison . Ordinal
40
20
: StringComparison . OrdinalIgnoreCase ;
41
21
42
- /// <summary>
43
- /// Converts all alternate path separators to the current platform's main path separators.
44
- /// </summary>
45
- /// <param name="path">The path to normalize.</param>
46
- /// <returns>The normalized path.</returns>
47
- public static string NormalizePathSeparators ( string path ) => string . IsNullOrWhiteSpace ( path ) ? path : path . Replace ( AlternatePathSeparator , DefaultPathSeparator ) ;
48
-
49
22
/// <summary>
50
23
/// Determines whether two specified strings represent the same path.
51
24
/// </summary>
@@ -67,8 +40,8 @@ internal static bool IsPathEqual(string left, string right)
67
40
return false ;
68
41
}
69
42
70
- left = Path . GetFullPath ( left ) . TrimEnd ( DefaultPathSeparator ) ;
71
- right = Path . GetFullPath ( right ) . TrimEnd ( DefaultPathSeparator ) ;
43
+ left = Path . GetFullPath ( left ) . TrimEnd ( Path . DirectorySeparatorChar ) ;
44
+ right = Path . GetFullPath ( right ) . TrimEnd ( Path . DirectorySeparatorChar ) ;
72
45
return left . Equals ( right , PathComparison ) ;
73
46
}
74
47
0 commit comments