Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle discontinuous input i.e. stdin #197

Merged
merged 3 commits into from
Jul 23, 2023

Conversation

sharifhsn
Copy link
Contributor

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.

@sharkdp sharkdp merged commit b6b7e2c into sharkdp:master Jul 23, 2023
@sharkdp
Copy link
Owner

sharkdp commented Jul 23, 2023

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect output when reading from terminal
2 participants