diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-03 01:20:18 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-03 01:26:07 -0800 |
commit | 55890dd7327178b8b04cd6aa895f1a9b4fb6ea99 (patch) | |
tree | 25856e1327e10a57941792600cc1e3b871f6f7a3 | |
parent | 75dac03adcdf79b8d38a87bf29f50bcde9fa46a5 (diff) | |
download | gzip-55890dd7327178b8b04cd6aa895f1a9b4fb6ea99.tar.gz |
zless: improve gzip failure checking
* zless.in: Use --show-preproc-error if available.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | zless.in | 11 |
2 files changed, 12 insertions, 1 deletions
@@ -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 @@ -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 "$@" |