diff --git a/less.spec b/less.spec index 3996bea..f31f225 100644 --- a/less.spec +++ b/less.spec @@ -68,6 +68,8 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d rm -rf $RPM_BUILD_ROOT %changelog +- Avoid some unnecessary stat calls and commands in lesspipe.sh, + patch by Ville Skyttä (#741440) - Use `groff' instead of `man -s' for rendering manpages to prevent options incompatibility between man and man-db packages (#718498) - Add groff to Requires diff --git a/lesspipe.sh b/lesspipe.sh index dcfc5db..e03d667 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -59,15 +59,17 @@ case "$1" in exit 1 fi ;; *) - if [ -x /usr/bin/file -a -x /usr/bin/iconv -a -x /usr/bin/cut ]; then + if [ -x /usr/bin/file ] && [ -x /usr/bin/iconv ] && [ -x /usr/bin/cut ]; then case `file -b "$1"` in *UTF-16*) conv='UTF-16' ;; *UTF-32*) conv='UTF-32' ;; esac - env=`echo $LANG | cut -d. -f2` - if [ -n "$conv" -a -n "$env" -a "$conv" != "$env" ]; then - iconv -f $conv -t $env "$1" - exit $? + if [ -n "$conv" ]; then + env=`echo $LANG | cut -d. -f2` + if [ -n "$env" -a "$conv" != "$env" ]; then + iconv -f $conv -t $env "$1" + exit $? + fi fi fi exit 1