Bug 73215 - Troubles with helper-programs invocations in 'lesspipe.sh'
Summary: Troubles with helper-programs invocations in 'lesspipe.sh'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: less
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-31 21:19 UTC by Michal Jaegermann
Modified: 2007-04-18 16:46 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-11-16 12:48:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2002-08-31 21:19:52 UTC
Description of Problem:

/usr/bin/lesspipe.sh includes the following lines:

		if echo "$1" | grep -q ^/; then	#absolute path
			man -- "$1" | cat -s
		else
			man -- "./$1" | cat -s
		fi

That would be not so bad in itself if not that small catch that 'man -- ...'
segfaults (see #73212).  Actually, regardless of bugs in man,

		if echo "$1" | grep -q ^/; then	#absolute path
			man "$1" | cat -s
		else
			man "./$1" | cat -s
		fi

does what was clearly intended here.

This bug was not introduced in (null) but seems to have pretty long history.
OTOH this line:

  *.tar.bz2|*.tbz2) bzip2 -dc "$1" | tar tvvf - ;;

from a (null) version of lesspipe.sh could likely benefit from

  *.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf - ;;

or, alternatively, one can do
echo "$1" | grep -q ^/ && data="$1" || data="./$1"
at the very beginning of lesspipe() function and use "$data" instead of "$1"
consistently all over the place.  Then '--', and possible troubles caused by
it, will be not needed.

Comment 1 Karsten Hopp 2002-09-03 13:22:40 UTC
The real bug was in man and has been fixed.

Comment 2 Michal Jaegermann 2002-09-03 16:33:09 UTC
Ahem!  The report was somewhat more general that one specific bug in 'man'
which forced a closer examination of that script.

In particular you should decide if you really want '--' with 'bzip2 -dc'
because now you have two variants in two separate occurences.  Note that
the proposed modification arguments would be always valid reagardles if
'--' was used, and accepted or not, by a particular utility.


Note You need to log in before you can comment on or make changes to this bug.