c7e9123
diff --git a/src/scripts/xzless.in b/src/scripts/xzless.in
c7e9123
index a3da697..288dd87 100644
c7e9123
--- a/src/scripts/xzless.in
c7e9123
+++ b/src/scripts/xzless.in
c7e9123
@@ -46,7 +46,7 @@ if test "${LESSMETACHARS+set}" != set; then
c7e9123
 	LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
c7e9123
 fi
c7e9123
 
c7e9123
-if test "$(less -V | { read ver && echo ${ver#less }; })" -ge 429; then
c7e9123
+if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
c7e9123
 	# less 429 or later: LESSOPEN pipe will be used on
c7e9123
 	# standard input if $LESSOPEN begins with |-.
c7e9123
 	LESSOPEN="|-$xz -cdfq -- %s"