diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHelpers.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHelpers.cs index 6896e2614b1c2..4cc4f8b120fd9 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHelpers.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHelpers.cs @@ -442,9 +442,8 @@ private static bool IsChildPath(string parentFullPath, string childFullPath) return childFullPath.StartsWith(parentFullPath, PathInternal.StringComparison); - // We don't need to check for AltDirectorySeparatorChar, full paths are normalized to DirectorySeparatorChar. static bool IsDirectorySeparatorChar(char c) - => c == Path.DirectorySeparatorChar; + => c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; } } }