From 532ba4528edf3aa8ad3859fa674ebe224ced9f1e Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: May 22 2014 14:53:02 +0000 Subject: - (lesspipe) the groff was used just in case of gzipped man pages - (lesspipe) the exit $? should be used directly after command; otherwise may return unexpected value. - (lesspipe) not preprocessed output was returning 1 --- diff --git a/less.spec b/less.spec index dfce827..fa77f5c 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less Version: 458 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv3+ Group: Applications/Text Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz @@ -76,6 +76,12 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d rm -rf $RPM_BUILD_ROOT %changelog +* Thu May 22 2014 Jozef Mlich - 458-8 +- (lesspipe) the groff was used just in case of gzipped man pages +- (lesspipe) the exit $? should be used directly after command; + otherwise may return unexpected value. +- (lesspipe) not preprocessed output was returning 1 + * Mon Mar 31 2014 Jozef Mlich - 458-7 - FIXES outdated ubin_table in charset.c; Kudos to Akira TAGOH diff --git a/lesspipe.sh b/lesspipe.sh index ede84db..1a0b0f3 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -43,7 +43,7 @@ case "$1" in fi ;;& *.[1-9n]|*.[1-9]x|*.man) if file "$1" | grep -q troff; then - man -l "$1" | cat -s + groff -Tascii -mandoc "$1" | cat -s exit $? fi ;;& *.tar) tar tvvf "$1" ;; @@ -60,8 +60,10 @@ case "$1" in *.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif) if [ -x /usr/bin/identify ]; then identify "$1" + exit $? elif [ -x /usr/bin/gm ]; then gm identify "$1" + exit $? else echo "No identify available" echo "Install ImageMagick or GraphicsMagick to browse images" @@ -81,7 +83,8 @@ case "$1" in fi fi fi - exit 1 + cat "$1" + exit $? esac -exit $? +