summaryrefslogtreecommitdiff
path: root/gzip.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-12-01 15:38:02 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-12-15 15:04:50 -0800
commitcf26200380585019e927fe3cf5c0ecb7c8b3ef14 (patch)
tree0601d06babe8944698e14b7fc3889a06bdb942f9 /gzip.h
parent1440bdbd16cc40f3ef3d0d91106373e29611f528 (diff)
downloadgzip-cf26200380585019e927fe3cf5c0ecb7c8b3ef14.tar.gz
gzip: gzip -l now outputs accurate size
gzip -l now decompresses to see how long the uncompressed file was. This fixes what is by far the most common bug report for gzip. It has a significant performance cost, but it’s worth it nowadays. * gzip.c (main): -l now sets 'test' too. All uses of 'test' changed. (treat_stdin, treat_file): Call do_list after decompressing, so that the length is known. (do_list): Omit arg IFD, since it is no longer needed. All callers changed. Get the CRC and uncompressed size from input_crc and bytes_out instead of using lseek. * tests/list-big: New test. * unzip.c (unzip): Set unzip_crc before returning. * util.c (write_buf): If 'test', output nothing. Update bytes_out with output byte count, regardless of 'test'. All callers changed.
Diffstat (limited to 'gzip.h')
-rw-r--r--gzip.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gzip.h b/gzip.h
index db0305f..ebe3213 100644
--- a/gzip.h
+++ b/gzip.h
@@ -262,6 +262,7 @@ extern int zip (int in, int out);
extern int file_read (char *buf, unsigned size);
/* in unzip.c */
+extern ulg unzip_crc;
extern int unzip (int in, int out);
extern int check_zipfile (int in);