Skip to content

Commit

Permalink
Fix redist
Browse files Browse the repository at this point in the history
Signed-off-by: dotnet-bot <[email protected]>


Commit migrated from dotnet/coreclr@439ed82
  • Loading branch information
JeremyKuhne authored and jkotas committed Jun 8, 2019
1 parent 5f3ed6e commit 6632eca
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ internal static partial class PathInternal
/// </summary>
internal static bool StartsWithDirectorySeparator(ReadOnlySpan<char> path) => path.Length > 0 && IsDirectorySeparator(path[0]);

#if MS_IO_REDIST
internal static string EnsureTrailingSeparator(string path)
=> Path.EndsInDirectorySeparator(path.AsSpan()) ? path : path + DirectorySeparatorCharAsString;
=> EndsInDirectorySeparator(path) ? path : path + DirectorySeparatorCharAsString;

internal static bool EndsInDirectorySeparator(string path)
=> !string.IsNullOrEmpty(path) && IsDirectorySeparator(path[path.Length - 1]);
#else
internal static string EnsureTrailingSeparator(string path)
=> Path.EndsInDirectorySeparator(path.AsSpan()) ? path : path + DirectorySeparatorCharAsString;
#endif

internal static bool IsRoot(ReadOnlySpan<char> path)
=> path.Length == GetRootLength(path);
Expand Down

0 comments on commit 6632eca

Please sign in to comment.