This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Discard errors when testing for less -R
authorH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Sat, 26 Jul 2014 15:12:28 +0000 (17:12 +0200)
committerH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Sat, 26 Jul 2014 15:12:28 +0000 (17:12 +0200)
When we try replacing 'less' with 'less -R', it's possible
that less will output errors if the option is not supported;
this happens, for example, in busybox's less.

Backport of a872f748481d44baa8bc0f6eb29659782c96ba7f
Author: Brian Fraser <fraserbn@gmail.com>  2014-07-25 19:13:26

U/modified/Loc.U

index 96a9830..0055b4d 100644 (file)
@@ -300,7 +300,7 @@ esac
 @if less
 case "$less" in
 '')    ;;
-*)     if $less -R </dev/null >/dev/null; then
+*)     if $less -R </dev/null >/dev/null 2>&1; then
               echo "Substituting less -R for less."
               less="$less -R"
               _less=$less