Skip to content

Commit

Permalink
fix bug where all data blocks were not extracted to file
Browse files Browse the repository at this point in the history
  • Loading branch information
reset committed Mar 17, 2016
1 parent bf61843 commit fdb44e1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions vendor/libarchive-rust/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,20 @@ impl Disk {
let mut offset = 0;

unsafe {
match ffi::archive_read_data_block(reader.handle(), &mut buff, &mut size, &mut offset) {
ffi::ARCHIVE_EOF => Ok(size),
ffi::ARCHIVE_OK => {
if ffi::archive_write_data_block(self.handle, buff, size, offset) < 0 {
Err(ArchiveError::from(self as &Handle))
} else {
Ok(size)
loop {
match ffi::archive_read_data_block(reader.handle(),
&mut buff,
&mut size,
&mut offset) {
ffi::ARCHIVE_EOF => return Ok(size),
ffi::ARCHIVE_OK => {
if ffi::archive_write_data_block(self.handle, buff, size, offset) !=
ffi::ARCHIVE_OK as isize {
return Err(ArchiveError::from(self as &Handle));
}
}
_ => return Err(ArchiveError::from(reader as &Handle)),
}
_ => Err(ArchiveError::from(reader as &Handle)),
}
}
}
Expand Down

1 comment on commit fdb44e1

@chef-delivery
Copy link
Contributor

Choose a reason for hiding this comment

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

Delivery Status:

Verify Build Acceptance
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/verify', target='_blank'><img src='https://img.shields.io/badge/Unit-Passed-brightgreen.svg', alt='Unit'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Unit-Passed-brightgreen.svg', alt='Unit'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/acceptance', target='_blank'><img src='https://img.shields.io/badge/Provision-Passed-brightgreen.svg', alt='Provision'>
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/verify', target='_blank'><img src='https://img.shields.io/badge/Lint-Passed-brightgreen.svg', alt='Lint'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Lint-Passed-brightgreen.svg', alt='Lint'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/acceptance', target='_blank'><img src='https://img.shields.io/badge/Deploy-Skipped-lightgrey.svg', alt='Deploy'>
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/verify', target='_blank'><img src='https://img.shields.io/badge/Syntax-Skipped-lightgrey.svg', alt='Syntax'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Syntax-Skipped-lightgrey.svg', alt='Syntax'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/acceptance', target='_blank'><img src='https://img.shields.io/badge/Smoke-Skipped-lightgrey.svg', alt='Smoke'>
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Quality-Skipped-lightgrey.svg', alt='Quality'> <a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/acceptance', target='_blank'><img src='https://img.shields.io/badge/Functional-Passed-brightgreen.svg', alt='Functional'>
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Security-Skipped-lightgrey.svg', alt='Security'>
<a href='https://delivery.chef.co/e/chef/#/organizations/bldr/projects/bldr/changes/590f6b11-fd06-414e-a192-318fabcb312e/status/build', target='_blank'><img src='https://img.shields.io/badge/Publish-Skipped-lightgrey.svg', alt='Publish'>

Please sign in to comment.