[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was
From: |
Ludovic Courtès |
Subject: |
[bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for. |
Date: |
Sun, 26 May 2019 23:28:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Pierre Neidhardt <address@hidden> skribis:
> Ludovic Courtès <address@hidden> writes:
>
>> Pierre Neidhardt <address@hidden> skribis:
>>
>>>> Fixes a bug whereby 'lzread!' could return more than COUNT.
>>>
>>> Hmm... But why is this a bug?
>>
>> Because then the ‘read!’ method of the custom binary input port could
>> return more than ‘count’, which is understandably not permitted.
>
> That's the part where I'm a bit confused because we deal with compressed
> data here.
>
> So when we say "(read count)", does COUNT refer to the compressed or
> uncompressed data?
We have this:
(define* (make-lzip-input-port port)
(define decoder (lz-decompress-open))
(define (read! bv start count)
(lzread! decoder port bv start count))
(make-custom-binary-input-port "lzip-input" read! #f #f
(lambda () …)))
Here ‘read!’ must return an integer between 1 and COUNT; it must return
0 if and only if the end-of-file is reached.
IOW, ‘lzread!’ must return the number of uncompressed bytes of BV that
it consumed, and that number is necessarily <= COUNT.
Does that make sense?
Thanks,
Ludo’.
- [bug#35880] [PATCH 2/7] utils: Test 'compressed-port' and 'decompressed-port' for both gzip and xz., (continued)
- [bug#35880] [PATCH 5/7] self: Add dependency on lzlib., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 6/7] gnu: guix: Add dependency on lzlib., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/25
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/26
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/26
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for.,
Ludovic Courtès <=
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/27
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/27
[bug#35880] [PATCH 4/7] publish: Add support for lzip., Ludovic Courtès, 2019/05/24
[bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/25
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/26
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/27
- bug#35880: [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/28