JuliaIO / Tar.jl

TAR files: create, list, extract them in pure Julia
MIT License
79 stars 19 forks source link

fix read_data bug & use in read_standard_header #112

Closed StefanKarpinski closed 3 years ago

StefanKarpinski commented 3 years ago

The read_data(::iO) method previously used a single call to readbytes! which is incorrect since readbytes! only reads as many bytes as is currently available and doesn't block to get more data. This change fixes that bug by using read! with a view buffer, which was only added to Base in Julia 1.4, so this also conditionally adds that method to read! if necessary.

codecov[bot] commented 3 years ago

Codecov Report

Merging #112 (3a212cc) into master (f06ba79) will decrease coverage by 0.41%. The diff coverage is 84.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
- Coverage   96.47%   96.05%   -0.42%     
==========================================
  Files           4        4              
  Lines         681      685       +4     
==========================================
+ Hits          657      658       +1     
- Misses         24       27       +3     
Impacted Files Coverage Δ
src/Tar.jl 92.77% <50.00%> (-3.34%) :arrow_down:
src/extract.jl 96.59% <100.00%> (-0.02%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f06ba79...3a212cc. Read the comment docs.

StefanKarpinski commented 3 years ago

Wow, I seem to have hung all the 32-bit tests except for one.