Stephen Kitt
2018-10-02 06:49:29 UTC
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 <***@sk2.org>
---
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 {
a way to view the stored file's size when it's larger than 4GiB.
Signed-off-by: Stephen Kitt <***@sk2.org>
---
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
2.11.0