From 94f033e2c43ac0a24c1c1f6582a538ffffffae6a Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 30 May 2023 18:35:45 -0500 Subject: [PATCH 1/2] Remove comment in ZipFile.Create.cs In #85491 the stream-based version of the `DoCreateFromDirectory` override copy-pasted comments from the string-based version ```csharp // Rely on Path.GetFullPath for validation of sourceDirectoryName and destinationArchive ``` The last clause of that comment is not relevant in the stream-based version (the argument is `Stream destination`) so deleted that clause. It's possible that the other comment is also misleading as we test the `compressionLevel ` argument just above (unlike in the `String destinationArchive` version ```csharp // Checking of compressionLevel is passed down to DeflateStream and the IDeflater implementation // as it is a pluggable component that completely encapsulates the meaning of compressionLevel. ``` --- .../src/System/IO/Compression/ZipFile.Create.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs index ba088ab15d024..d1c2f97756c00 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs @@ -459,7 +459,7 @@ private static void DoCreateFromDirectory(string sourceDirectoryName, Stream des throw new ArgumentOutOfRangeException(nameof(compressionLevel)); } - // Rely on Path.GetFullPath for validation of sourceDirectoryName and destinationArchive + // Rely on Path.GetFullPath for validation of sourceDirectoryName // Checking of compressionLevel is passed down to DeflateStream and the IDeflater implementation // as it is a pluggable component that completely encapsulates the meaning of compressionLevel. From 6a6102c223ad35700222f0298e41d5a10dcf2564 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 30 May 2023 19:59:17 -0500 Subject: [PATCH 2/2] Remove compressionLevel validation comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com> --- .../src/System/IO/Compression/ZipFile.Create.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs index d1c2f97756c00..5cd64ca6156bd 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs @@ -461,9 +461,6 @@ private static void DoCreateFromDirectory(string sourceDirectoryName, Stream des // Rely on Path.GetFullPath for validation of sourceDirectoryName - // Checking of compressionLevel is passed down to DeflateStream and the IDeflater implementation - // as it is a pluggable component that completely encapsulates the meaning of compressionLevel. - sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); using ZipArchive archive = new ZipArchive(destination, ZipArchiveMode.Create, leaveOpen: true, entryNameEncoding);