aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2021-06-04 18:52:48 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-07-12 19:01:09 +0300
commit8d0fd42fbedd01fd3c847b56d19841e603500dea (patch)
tree1d6da36fee9d3ab04ca3cfffed642848f17e8936
parentxz: Document the special memlimit case of 2000 MiB on MIPS32. (diff)
downloadxz-8d0fd42fbedd01fd3c847b56d19841e603500dea.tar.xz
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 <https://bugs.gentoo.org/489362> in 2013.
-rw-r--r--src/scripts/xzless.in2
1 files changed, 1 insertions, 1 deletions
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"