diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/decompress.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/decompress.c b/src/decompress.c index fbf33ec..fef4241 100644 --- a/src/decompress.c +++ b/src/decompress.c | |||
@@ -17,7 +17,7 @@ int main(int argc, char **argv) { | |||
17 | unsigned char output [HUGEBLOCK]; | 17 | unsigned char output [HUGEBLOCK]; |
18 | char respath[32]; /* file_XXXXX\0 */ | 18 | char respath[32]; /* file_XXXXX\0 */ |
19 | int i, zres = 0, filenum = 0, resfile; | 19 | int i, zres = 0, filenum = 0, resfile; |
20 | size_t offs = 0; | 20 | size_t offs = 0, reported = 0; |
21 | 21 | ||
22 | z_stream z; memset( &z, 0, sizeof(z)); | 22 | z_stream z; memset( &z, 0, sizeof(z)); |
23 | 23 | ||
@@ -49,6 +49,12 @@ error_continue: | |||
49 | close( resfile ); | 49 | close( resfile ); |
50 | offs += z.total_in; | 50 | offs += z.total_in; |
51 | 51 | ||
52 | if( reported < ( offs * 10 ) / in->size ) { | ||
53 | reported++; | ||
54 | printf( "%zd%% ", 10 * reported ); | ||
55 | fflush( stdout ); | ||
56 | } | ||
57 | |||
52 | inflateEnd(&z); memset( &z, 0, sizeof(z)); | 58 | inflateEnd(&z); memset( &z, 0, sizeof(z)); |
53 | } | 59 | } |
54 | unmap_file(&in); | 60 | unmap_file(&in); |