#575884 Piping in to gzip -l produces broken stats output

Package:
gzip
Source:
gzip
Description:
GNU compression utilities
Submitter:
Ben Klein
Date:
2010-03-30 04:42:05 UTC
Severity:
normal
#575884#5
Date:
2010-03-30 04:27:47 UTC
From:
To:
The command:
$ gzip -c foo | gzip -l -
produces the following output consistently:
         compressed        uncompressed  ratio uncompressed_name
                 -1                  -1   0.0% stdout

This is not the expected output, as demonstrated by:
$ gzip -c foo > foo.gz
$ gzip -l - < foo.gz
         compressed        uncompressed  ratio uncompressed_name
               2023                5006  60.2% stdout
$ cat foo.gz | gzip -l -
         compressed        uncompressed  ratio uncompressed_name
                 -1                  -1   0.0% stdout

It's clear that this bug only affects piped input into gzip -l. Why piped input
should be handled differently to stdin input is beyond me.