summaryrefslogtreecommitdiff
path: root/archival/libunarchive/decompress_unzip.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-01 15:55:11 +0000
committerDenis Vlasenko2006-10-01 15:55:11 +0000
commit97a8dd3857aea9730382e2975a2ee2000fd23ebb (patch)
tree608f73898f3ed5f466dff68189625fa9328a15be /archival/libunarchive/decompress_unzip.c
parentf8aa109a9f7c67b291f240fb3ed91da90f26359b (diff)
downloadbusybox-97a8dd3857aea9730382e2975a2ee2000fd23ebb.zip
busybox-97a8dd3857aea9730382e2975a2ee2000fd23ebb.tar.gz
g[un]zip: add support for -v (verbose).
Add CONFIG_DESKTOP, almost all bloat from this change is hidden under that.
Diffstat (limited to 'archival/libunarchive/decompress_unzip.c')
-rw-r--r--archival/libunarchive/decompress_unzip.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 989ac4f..27b4ddb 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -835,8 +835,10 @@ void inflate_cleanup(void)
free(bytebuffer);
}
-int inflate_unzip(int in, int out)
+USE_DESKTOP(long long) int
+inflate_unzip(int in, int out)
{
+ USE_DESKTOP(long long total = 0;)
ssize_t nwrote;
typedef void (*sig_type) (int);
@@ -864,6 +866,7 @@ int inflate_unzip(int in, int out)
bb_perror_msg("write");
return -1;
}
+ USE_DESKTOP(total += nwrote;)
if (ret == 0) break;
}
@@ -880,15 +883,17 @@ int inflate_unzip(int in, int out)
gunzip_bb >>= 8;
gunzip_bk -= 8;
}
- return 0;
+ return USE_DESKTOP(total) + 0;
}
-int inflate_gunzip(int in, int out)
+USE_DESKTOP(long long) int
+inflate_gunzip(int in, int out)
{
uint32_t stored_crc = 0;
unsigned int count;
+ USE_DESKTOP(long long total = )inflate_unzip(in, out);
- inflate_unzip(in, out);
+ USE_DESKTOP(if (total < 0) return total;)
/* top up the input buffer with the rest of the trailer */
count = bytebuffer_size - bytebuffer_offset;
@@ -915,5 +920,5 @@ int inflate_gunzip(int in, int out)
return -1;
}
- return 0;
+ return USE_DESKTOP(total) + 0;
}