Skip to content

Commit

Permalink
Merge pull request #67 from vbatts/troubleshoot_65
Browse files Browse the repository at this point in the history
don't add a padding entry if it has no bytes
  • Loading branch information
vbatts authored Jul 21, 2023
2 parents db25994 + b637241 commit 9982e47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tar/asm/assemble_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ var testCases = []struct {
{"./testdata/iso-8859.tar.gz", "ddafa51cb03c74ec117ab366ee2240d13bba1ec3", 10240},
{"./testdata/extranils.tar.gz", "e187b4b3e739deaccc257342f4940f34403dc588", 10648},
{"./testdata/notenoughnils.tar.gz", "72f93f41efd95290baa5c174c234f5d4c22ce601", 512},
{"./testdata/1c51fc286aa95d9413226599576bafa38490b1e292375c90de095855b64caea6", "946caa03167a8cc707db6ff9785608b652e631dc", 1024},
}

func TestTarStream(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions tar/asm/disassemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
}
isEOF = true
}
if n == 0 {
break
}
_, err = p.AddEntry(storage.Entry{
Type: storage.SegmentType,
Payload: paddingChunk[:n],
Expand Down
Binary file not shown.

0 comments on commit 9982e47

Please sign in to comment.