lzlib: 'make-lzip-input-port' better handles end of decompression.
Suggested by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/lzlib.scm (lzread!): Call 'lz-decompress-finish' when 'feed-decoder!' returns EOF. Call 'lz-decompress-finished?' to determine end of compression.
This commit is contained in:
parent
b6cf7e54ea
commit
87399dfc20
|
@ -510,9 +510,13 @@ the end-of-stream has been reached."
|
||||||
(start start))
|
(start start))
|
||||||
(cond ((< read count)
|
(cond ((< read count)
|
||||||
(match (lz-decompress-read decoder bv start (- count read))
|
(match (lz-decompress-read decoder bv start (- count read))
|
||||||
(0 (if (eof-object? (feed-decoder! decoder))
|
(0 (cond ((lz-decompress-finished? decoder)
|
||||||
read
|
read)
|
||||||
(loop read start)))
|
((eof-object? (feed-decoder! decoder))
|
||||||
|
(lz-decompress-finish decoder)
|
||||||
|
(loop read start))
|
||||||
|
(else ;read again
|
||||||
|
(loop read start))))
|
||||||
(n (loop (+ read n) (+ start n)))))
|
(n (loop (+ read n) (+ start n)))))
|
||||||
(else
|
(else
|
||||||
read))))
|
read))))
|
||||||
|
|
Loading…
Reference in New Issue