summaryrefslogtreecommitdiff
path: root/libarchive/archive_write_set_format_pax.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-09 01:42:25 -0500
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-09 01:42:25 -0500
commit818a8ac43100a1c2bae60d7cb9293b147676adac (patch)
tree3b887e52fdf531dd4a9f72d881bc5047864bd3c2 /libarchive/archive_write_set_format_pax.c
parent929370e11d907044e8c5a1bc505d7905bfe000ba (diff)
downloadlibarchive-818a8ac43100a1c2bae60d7cb9293b147676adac.tar.gz
Fix a handling of spase file more. It wrote extra bytes(adding sparse hole)
when sparse file data was incompletely written. SVN-Revision: 4103
Diffstat (limited to 'libarchive/archive_write_set_format_pax.c')
-rw-r--r--libarchive/archive_write_set_format_pax.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c
index 4caace51..a62d99df 100644
--- a/libarchive/archive_write_set_format_pax.c
+++ b/libarchive/archive_write_set_format_pax.c
@@ -1596,7 +1596,8 @@ archive_write_pax_finish_entry(struct archive_write *a)
if (remaining == 0) {
while (pax->sparse_list) {
struct sparse_block *sb;
- remaining += pax->sparse_list->remaining;
+ if (!pax->sparse_list->is_hole)
+ remaining += pax->sparse_list->remaining;
sb = pax->sparse_list->next;
free(pax->sparse_list);
pax->sparse_list = sb;