Possible bug in less

John Gilmore gnu at l5.uucp
Wed Nov 13 19:52:32 AEST 1985


In article <781 at whuxl.UUCP>, qtest at whuxl.UUCP (QTEST) writes:
> I think I've found a bug in less. 
> 	1) 	cat filename | less	
> 	2)	less filename
> If the command "!sh" is entered, command type 1) will wait for a few seconds
> and then return "!done (press RETURN)".

The problem is that "less" just forks a shell, passing standard
input, output, and error to it (and any other files it has open).
If the standard input of "less" is the output of "cat", this (or
whatever part of it "less" hasn't read) will be the input to the shell.

I have a fix for this but I didn't keep separate diffs.  I've been
working on "less" and will send all my changes to mod.sources someday.
I don't think the fix is really urgent.  If you have to, just use the
"!sh </dev/tty" command instead.



More information about the Comp.sources.bugs mailing list