Thanks, I installed the attached patch to attempt to work around the problems you reported.

Could you please explain how ignoring the 'less -V' failure causes zless to work on BusyBox? BusyBox 'less' ignores the LESSOPEN environment variable, so if zless uses Busybox 'less' then zless should not work even if the attached fix is applied.
From b49af9aa63c907a32bf842f2075dc8c2d983477d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 13 Mar 2017 16:35:55 -0700
Subject: [PATCH] gzip: port zdiff, zless to Busybox

Problem reported by Denys Zagorui (Bug#26088).
* tests/zdiff: Check that diff uses POSIX-format output.
* zless.in (less_version): Don't exit merely because 'less -V'
fails; instead, assume 'less' is compatible with an old version of
the original 'less'.  Busybox 'less -V' fails, but apparently its
'less' works anyway somehow.
---
 tests/zdiff | 4 +++-
 zless.in    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/zdiff b/tests/zdiff
index 7ed2f34..e2ca651 100755
--- a/tests/zdiff
+++ b/tests/zdiff
@@ -22,7 +22,6 @@
 
 echo a > a || framework_failure_
 echo b > b || framework_failure_
-gzip a b || framework_failure_
 
 cat <<EOF > exp
 1c1
@@ -31,7 +30,10 @@ cat <<EOF > exp
 > b
 EOF
 
+diff a b | diff exp - || skip_ "diff output format is incompatible with POSIX"
+
 fail=0
+gzip a b || fail=1
 returns_ 1 zdiff a.gz b.gz > out 2>&1 || fail=1
 
 compare exp out || fail=1
diff --git a/zless.in b/zless.in
index 25d6b8b..fdcc49a 100644
--- a/zless.in
+++ b/zless.in
@@ -47,7 +47,7 @@ if test "${LESSMETACHARS+set}" != set; then
   export LESSMETACHARS
 fi
 
-less_version=`less -V` || exit
+less_version=`less -V 2>/dev/null`
 case $less_version in
 less' '45[1-9]* | \
 less' '4[6-9][0-9]* | \
-- 
2.9.3

Reply via email to