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 issue where tab was incorrectly matching as binary file #150

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion mrblib/rf/buffered_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def fill_buffer(size = BUFFER_SIZE)
if read_data.nil? || read_data.empty?
@end_of_file = true
else
@binary = true if /(?![\r\n])\p{Cntrl}/.match?(read_data)
@binary = true if /(?![\r\n\t])\p{Cntrl}/.match?(read_data)

@buffer << read_data
end
Expand Down
8 changes: 8 additions & 0 deletions spec/binary_file_match_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@

it_behaves_like 'a successful exec'
end

describe 'non-binary file' do
let(:input) { "hello\tworld\n" }
let(:args) { '_' }
let(:expect_output) { "hello\tworld" }

it_behaves_like 'a successful exec'
end
end