bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32903: [PATCH] Display uncompressed size when testing


From: Stephen Kitt
Subject: bug#32903: [PATCH] Display uncompressed size when testing
Date: Tue, 2 Oct 2018 08:49:29 +0200

Alongside the OK message, print the real size in bytes; this provides
a way to view the stored file's size when it's larger than 4GiB.

Signed-off-by: Stephen Kitt <address@hidden>
---
 gzip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gzip.c b/gzip.c
index e6a7761..4104472 100644
--- a/gzip.c
+++ b/gzip.c
@@ -62,6 +62,7 @@ static char const *const license_msg[] = {
 #include <stddef.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <inttypes.h>
 
 #include "tailor.h"
 #include "gzip.h"
@@ -807,7 +808,7 @@ local void treat_stdin()
 
     if (verbose) {
         if (test) {
-            fprintf(stderr, " OK\n");
+            fprintf(stderr, " OK (%jd bytes)\n", (intmax_t) bytes_out);
 
         } else if (!decompress) {
             display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
@@ -1060,7 +1061,7 @@ local void treat_file(iname)
     /* Display statistics */
     if(verbose) {
         if (test) {
-            fprintf(stderr, " OK");
+            fprintf(stderr, " OK (%jd bytes)", (int_max_t) bytes_out);
         } else if (decompress) {
             display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
         } else {
-- 
2.11.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]