Skip to content

Commit

Permalink
Fix extracting sparse files
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Feb 8, 2017
1 parent 7957c5b commit 2085a3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libpkg/pkg_add.c
Expand Up @@ -533,6 +533,10 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
dprintf(fd, "%s", cfdata);
if (f->config->newcontent != NULL)
free(f->config->newcontent);
} else {
if (ftruncate(fd, archive_entry_size(ae)) == -1) {
pkg_errno("Fail to truncate file: %s", f->temppath);
}
}

if (!f->config && archive_read_data_into_fd(a, fd) != ARCHIVE_OK) {
Expand Down

0 comments on commit 2085a3e

Please sign in to comment.