Instead of reporting some bogus values, print no progress at all.
(It's beyond me why stat(2) on a pipe returns funny values...
see the PR below for some examples!)
Fixes PR bin/33207 by myself.
OK'd by mrg@
This adds a -e option to progress which causes the progress bar to be
sent to stderr. This allows using progress mid-pipe, such as:
tar -cf . | progress -e bzip -1c | ssh host "cat > file"
Decode gzip -l output with strtoimax() (not sscanf()) so we don't use an
uninitialised variable if the output format isn't what we expect.
This might fix some installation PRs (no error being reported)
Closes bin/20275, thank you Takao Shinohara: good analysis.
This program appeared less than 3 weeks ago and it has already been
pulled up to 1.6.1? At the last minute? And with serious bugs?
ISTM that the release branch isn't supposed to work that way. It
isn't stable, it had 4 patches in 2 days, and has averaged a
patch every 4 days during its short lifetime.