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

fix: don't panic when piping #82

Merged
merged 1 commit into from
Feb 18, 2023
Merged

fix: don't panic when piping #82

merged 1 commit into from
Feb 18, 2023

Conversation

Witcher01
Copy link
Contributor

Piping stdout to something like head, which closes rbw's stdout before
it's done writing everything, causes a panic.
The panic is circumvented by using writeln! instead of println! and
ignoring the error when it's of kind BrokenPipe.
Closes #79

Piping stdout to something like `head`, which closes rbw's stdout before
it's done writing everything, causes a panic.
The panic is circumvented by using `writeln!` instead of `println!` and
ignoring the error when it's of kind `BrokenPipe`.
Closes doy#79
@svenstaro
Copy link

@doy could you take a look at this?

@svenstaro
Copy link

@doy ping

Comment on lines +536 to +537
// write to stdout but don't panic when pipe get's closed
// this happens when piping stdout in a shell

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// write to stdout but don't panic when pipe get's closed
// this happens when piping stdout in a shell
// Write to stdout but don't panic when pipe gets closed
// which is what happens when piping stdout in a shell.

@doy doy merged commit c32e1da into doy:master Feb 18, 2023
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.

panic when piping to head
4 participants