mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 15:34:34 +00:00
test clean up and formatting
This commit is contained in:
@@ -9,7 +9,6 @@ namespace SharpCompress.Archives;
|
||||
|
||||
public static class IArchiveExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets the appropriate StringComparison for path checks based on the file system.
|
||||
/// Windows uses case-insensitive file systems, while Unix-like systems use case-sensitive file systems.
|
||||
@@ -76,12 +75,13 @@ public static class IArchiveExtensions
|
||||
{
|
||||
if (entry.IsDirectory)
|
||||
{
|
||||
|
||||
var folder = Path.GetDirectoryName(entry.Key.NotNull("Entry Key is null"))
|
||||
.NotNull("Directory is null");
|
||||
var destdir = Path.GetFullPath(Path.Combine(fullDestinationDirectoryPath, folder));
|
||||
.NotNull("Directory is null");
|
||||
var destdir = Path.GetFullPath(
|
||||
Path.Combine(fullDestinationDirectoryPath, folder)
|
||||
);
|
||||
|
||||
if (!Directory.Exists(destdir) && seenDirectories.Add(destdir))
|
||||
if (!Directory.Exists(destdir) && seenDirectories.Add(destdir))
|
||||
{
|
||||
if (!destdir.StartsWith(fullDestinationDirectoryPath, PathComparison))
|
||||
{
|
||||
|
||||
@@ -67,7 +67,8 @@ public static class IAsyncArchiveExtensions
|
||||
IProgress<ProgressReport>? progress,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{ var fullDestinationDirectoryPath = Path.GetFullPath(destinationDirectory);
|
||||
{
|
||||
var fullDestinationDirectoryPath = Path.GetFullPath(destinationDirectory);
|
||||
options ??= new ExtractionOptions();
|
||||
|
||||
//check for trailing slash.
|
||||
@@ -97,10 +98,12 @@ public static class IAsyncArchiveExtensions
|
||||
if (entry.IsDirectory)
|
||||
{
|
||||
var folder = Path.GetDirectoryName(entry.Key.NotNull("Entry Key is null"))
|
||||
.NotNull("Directory is null");
|
||||
var destdir = Path.GetFullPath(Path.Combine(fullDestinationDirectoryPath, folder));
|
||||
.NotNull("Directory is null");
|
||||
var destdir = Path.GetFullPath(
|
||||
Path.Combine(fullDestinationDirectoryPath, folder)
|
||||
);
|
||||
|
||||
if (!Directory.Exists(destdir) && seenDirectories.Add(destdir))
|
||||
if (!Directory.Exists(destdir) && seenDirectories.Add(destdir))
|
||||
{
|
||||
if (!destdir.StartsWith(fullDestinationDirectoryPath, PathComparison))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user