@@ -10,26 +10,6 @@ namespace Microsoft.PowerShell.EditorServices.Utility
1010{
1111 internal static class PathUtils
1212 {
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-
3313 /// <summary>
3414 /// The <see cref="StringComparison" /> value to be used when comparing paths. Will be
3515 /// <see cref="StringComparison.Ordinal" /> for case sensitive file systems and <see cref="StringComparison.OrdinalIgnoreCase" />
@@ -39,13 +19,6 @@ internal static class PathUtils
3919 ? StringComparison . Ordinal
4020 : StringComparison . OrdinalIgnoreCase ;
4121
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-
4922 /// <summary>
5023 /// Determines whether two specified strings represent the same path.
5124 /// </summary>
@@ -67,8 +40,8 @@ internal static bool IsPathEqual(string left, string right)
6740 return false ;
6841 }
6942
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 ) ;
7245 return left . Equals ( right , PathComparison ) ;
7346 }
7447
0 commit comments