Skip to content

Commit a4818aa

Browse files
committed
Z-1419 Last char of TAR file name was dropped if path length > 100
1 parent 05449a0 commit a4818aa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Tar/TarOutputStream.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
// obligated to do so. If you do not wish to do so, delete this
3535
// exception statement from your version.
3636

37+
// HISTORY
38+
// 2012-06-04 Z-1419 Last char of file name was dropped if path length > 100
39+
3740
using System;
3841
using System.IO;
3942

@@ -284,7 +287,7 @@ public void PutNextEntry(TarEntry entry)
284287
longHeader.GroupName = "";
285288
longHeader.UserName = "";
286289
longHeader.LinkName = "";
287-
longHeader.Size = entry.TarHeader.Name.Length;
290+
longHeader.Size = entry.TarHeader.Name.Length + 1; // Plus one to avoid dropping last char
288291

289292
longHeader.WriteHeader(blockBuffer);
290293
buffer.WriteBlock(blockBuffer); // Add special long filename header block

0 commit comments

Comments
 (0)