From 97a8dd3857aea9730382e2975a2ee2000fd23ebb Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Oct 2006 15:55:11 +0000 Subject: g[un]zip: add support for -v (verbose). Add CONFIG_DESKTOP, almost all bloat from this change is hidden under that. --- archival/libunarchive/decompress_unzip.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'archival/libunarchive/decompress_unzip.c') diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index 989ac4fd8..27b4ddbcf 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; } -- cgit v1.2.3