From: Lasse Collin Date: Fri, 4 Jun 2021 15:52:48 +0000 (+0300) Subject: xzless: Fix less(1) version detection when it contains a dot. X-Git-Tag: v5.3.2alpha~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96f5a28a46fc93ac4e296808ac0f8631d05498bc;p=thirdparty%2Fxz.git xzless: Fix less(1) version detection when it contains a dot. Sometimes the version number from "less -V" contains a dot, sometimes not. xzless failed detect the version number when it does contain a dot. This fixes it. Thanks to nick87720z for reporting this. Apparently it had been reported here in 2013. --- diff --git a/src/scripts/xzless.in b/src/scripts/xzless.in index cf61ab29..7215acec 100644 --- a/src/scripts/xzless.in +++ b/src/scripts/xzless.in @@ -47,7 +47,7 @@ if test "${LESSMETACHARS+set}" != set; then LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~' fi -if test "$(less -V | { read _ ver _ && echo ${ver}; })" -ge 429; then +if test "$(less -V | { read _ ver _ && echo ${ver%%.*}; })" -ge 429; then # less 429 or later: LESSOPEN pipe will be used on # standard input if $LESSOPEN begins with |-. LESSOPEN="|-$xz -cdfq -- %s"