mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-11-15 17:02:03 +00:00
Fix empty and directory-only 7z archive finalization
This commit is contained in:
@@ -43,6 +43,8 @@ public partial class SevenZipWriter
|
||||
|
||||
private async ValueTask FinalizeArchiveAsync()
|
||||
{
|
||||
// Reserve the signature even when no file data was written.
|
||||
await EnsurePlaceholderWrittenAsync(CancellationToken.None).ConfigureAwait(false);
|
||||
var output = OutputStream.NotNull();
|
||||
|
||||
// Current position = end of packed data streams
|
||||
|
||||
@@ -193,6 +193,8 @@ public partial class SevenZipWriter : AbstractWriter
|
||||
|
||||
private void FinalizeArchive()
|
||||
{
|
||||
// Directory-only and empty archives never pass through Write().
|
||||
EnsurePlaceholderWritten();
|
||||
var output = OutputStream.NotNull();
|
||||
|
||||
// Current position = end of packed data streams
|
||||
|
||||
Reference in New Issue
Block a user