mirror of
https://https.git.savannah.gnu.org/git/gzip.git
synced 2026-01-26 15:39:07 +00:00
zless: improve gzip failure checking
* zless.in: Use --show-preproc-error if available.
This commit is contained in:
parent
75dac03adc
commit
55890dd732
2
NEWS
2
NEWS
@ -4,6 +4,8 @@ GNU gzip NEWS -*- outline -*-
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
zless now diagnoses gzip failures, if using less 623 or later.
|
||||
|
||||
When SIGPIPE is ignored, gzip now exits with status 2 (warning)
|
||||
instead of status 1 (error) when writing to a broken pipe. This is
|
||||
more useful with programs like 'less' that treat gzip exit status 2
|
||||
|
||||
11
zless.in
11
zless.in
@ -64,8 +64,17 @@ less' '[1-9][0-9][0-9][0-9]*)
|
||||
use_input_pipe_on_stdin='-';;
|
||||
*) use_input_pipe_on_stdin='';;
|
||||
esac
|
||||
case $less_version in
|
||||
less' '623* | \
|
||||
less' '62[4-9]* | \
|
||||
less' '6[3-9][0-9]* | \
|
||||
less' '[7-9][0-9][0-9]* | \
|
||||
less' '[1-9][0-9][0-9][0-9]*)
|
||||
show_preproc_error='--show-preproc-error';;
|
||||
*) show_preproc_error='';;
|
||||
esac
|
||||
|
||||
LESSOPEN="|$check_exit_status${use_input_pipe_on_stdin}'gzip' -cdfq -- %s"
|
||||
export LESSOPEN
|
||||
|
||||
exec less "$@"
|
||||
exec less $show_preproc_error "$@"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user