From 979a8f34d1fa93558f6c0947d03bb8cdaeada7b5 Mon Sep 17 00:00:00 2001 From: kientzle Date: Fri, 18 Jan 2008 04:53:45 +0000 Subject: Reconnect the progress callback. It may not get called as often as you might expect, but at least it will get called now. Thanks to: David Topham for asking how this got disconnected. --- lib/libarchive/archive_read_extract.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/libarchive/archive_read_extract.c') diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index c69c34f..5eb0d36 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -67,6 +67,7 @@ get_extract(struct archive_read *a) archive_set_error(&a->archive, ENOMEM, "Can't extract"); return (NULL); } + memset(a->extract, 0, sizeof(*a->extract)); a->extract->ad = archive_write_disk_new(); if (a->extract->ad == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't extract"); @@ -130,11 +131,13 @@ archive_read_extract_set_progress_callback(struct archive *_a, static int copy_data(struct archive *ar, struct archive *aw) { - int r; + off_t offset; const void *buff; + struct extract *extract; size_t size; - off_t offset; + int r; + extract = get_extract((struct archive_read *)ar); for (;;) { r = archive_read_data_block(ar, &buff, &size, &offset); if (r == ARCHIVE_EOF) @@ -149,6 +152,9 @@ copy_data(struct archive *ar, struct archive *aw) "%s", archive_error_string(aw)); return (r); } + if (extract->extract_progress) + (extract->extract_progress) + (extract->extract_progress_user_data); } } -- cgit v1.1