mirror of
https://github.com/vbatts/tar-split.git
synced 2024-12-22 05:16:32 +00:00
Correctly handle Read returning (0, nil)
It's not an EOF indication. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
9982e470fa
commit
cd197d3076
1 changed files with 9 additions and 10 deletions
|
@ -135,9 +135,7 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
|
||||||
}
|
}
|
||||||
isEOF = true
|
isEOF = true
|
||||||
}
|
}
|
||||||
if n == 0 {
|
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],
|
||||||
|
@ -146,6 +144,7 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
|
||||||
pW.CloseWithError(err)
|
pW.CloseWithError(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if isEOF {
|
if isEOF {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue