mirror of
https://github.com/vbatts/tar-split.git
synced 2025-01-03 02:47:07 +00:00
Merge pull request #67 from vbatts/troubleshoot_65
don't add a padding entry if it has no bytes
This commit is contained in:
commit
9982e470fa
3 changed files with 4 additions and 0 deletions
|
@ -140,6 +140,7 @@ var testCases = []struct {
|
||||||
{"./testdata/iso-8859.tar.gz", "ddafa51cb03c74ec117ab366ee2240d13bba1ec3", 10240},
|
{"./testdata/iso-8859.tar.gz", "ddafa51cb03c74ec117ab366ee2240d13bba1ec3", 10240},
|
||||||
{"./testdata/extranils.tar.gz", "e187b4b3e739deaccc257342f4940f34403dc588", 10648},
|
{"./testdata/extranils.tar.gz", "e187b4b3e739deaccc257342f4940f34403dc588", 10648},
|
||||||
{"./testdata/notenoughnils.tar.gz", "72f93f41efd95290baa5c174c234f5d4c22ce601", 512},
|
{"./testdata/notenoughnils.tar.gz", "72f93f41efd95290baa5c174c234f5d4c22ce601", 512},
|
||||||
|
{"./testdata/1c51fc286aa95d9413226599576bafa38490b1e292375c90de095855b64caea6", "946caa03167a8cc707db6ff9785608b652e631dc", 1024},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTarStream(t *testing.T) {
|
func TestTarStream(t *testing.T) {
|
||||||
|
|
|
@ -135,6 +135,9 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
|
||||||
}
|
}
|
||||||
isEOF = true
|
isEOF = true
|
||||||
}
|
}
|
||||||
|
if n == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
_, err = p.AddEntry(storage.Entry{
|
_, err = p.AddEntry(storage.Entry{
|
||||||
Type: storage.SegmentType,
|
Type: storage.SegmentType,
|
||||||
Payload: paddingChunk[:n],
|
Payload: paddingChunk[:n],
|
||||||
|
|
BIN
tar/asm/testdata/1c51fc286aa95d9413226599576bafa38490b1e292375c90de095855b64caea6
vendored
Normal file
BIN
tar/asm/testdata/1c51fc286aa95d9413226599576bafa38490b1e292375c90de095855b64caea6
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue