less.csh: avoid unnecessary stat() call

Resolves: #1321591
Version: 481-3
This commit is contained in:
Pavel Raiskup 2016-03-29 09:39:48 +02:00
parent 11bfc57bdf
commit 32b553bce3
3 changed files with 18 additions and 5 deletions

View File

@ -1,8 +1,14 @@
# less initialization script (csh)
if ( -x /usr/bin/lesspipe.sh ) then
if ( $?LESSOPEN && { eval 'test ! -z "$LESSOPEN"' } ) then
:
else
# All less.*sh files should have the same semantics!
# In case you are curious, the test for non-emptiness is not as easy as in
# Bourne shell. This "eval" construct is probably inspired by Stack
# Overflow question 13343392.
if ( $?LESSOPEN && { eval 'test ! -z "$LESSOPEN"' } ) then
:
else
if ( -x /usr/bin/lesspipe.sh ) then
setenv LESSOPEN "|/usr/bin/lesspipe.sh %s"
endif
endif

View File

@ -1,4 +1,7 @@
# less initialization script (sh)
# All less.*sh files should have the same semantics!
if [ -z "$LESSOPEN" ] && [ -x /usr/bin/lesspipe.sh ]; then
export LESSOPEN="|/usr/bin/lesspipe.sh %s"
fi

View File

@ -1,7 +1,7 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 481
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv3+ or BSD
Group: Applications/Text
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
@ -67,6 +67,10 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
%{_mandir}/man1/*
%changelog
* Tue Mar 29 2016 Pavel Raiskup <praiskup@redhat.com> - 481-3
- avoid one ubiquitous stat() call in less.sh and less.csh if possible
(rhbz#1321591)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 481-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild