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 small file passthrough #3215

Merged
merged 1 commit into from
Jul 29, 2022
Merged

Conversation

cgbur
Copy link
Contributor

@cgbur cgbur commented Jul 27, 2022

Fixes passthrough on files with fewer than 4 magic bytes by checking if passthrough is enabled before exiting with an error. If force is enabled and destination is stdout, the bytes are copied as-is to the output.

Changes:

  • add a check for passthrough if we read fewer than 4 bytes (zstd magic length)
  • add a test to ensure passthrough works on short files

fixes: #3210
review @terrelln

Copy link
Contributor

@terrelln terrelln left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for the PR!

@terrelln terrelln merged commit 2b9fde9 into facebook:dev Jul 29, 2022
@Cyan4973 Cyan4973 mentioned this pull request Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passthrough on short files fails
3 participants