This PR properly handles the case when the reader is still available after returning an incomplete amount of data. When I initially rewrote the architecture of hexyl, I only handled spurious incomplete reads by adding a second check. However, stdin is a reader that can return incomplete reads multiple times.
This PR changes the second check to a loop that repeatedly reads until either the line buffer is filled or the reader is exhausted.
Fixes #196.
This PR properly handles the case when the reader is still available after returning an incomplete amount of data. When I initially rewrote the architecture of
hexyl
, I only handled spurious incomplete reads by adding a second check. However,stdin
is a reader that can return incomplete reads multiple times.This PR changes the second check to a loop that repeatedly reads until either the line buffer is filled or the reader is exhausted.