[mod.computers.laser-printers] Transcript ptroff bug

stanonik@NPRDC.ARPA (Ron Stanonik) (09/05/86)

We encountered a puzzling bug in the Transcript 2.0 ptroff.
The -t option (output postscript to standout) didn't work
when piping into ptroff; eg,
	tbl file | ptroff -t
Reversing the order of the arguments to the test in the while
loop seems to cure the problem; eg,
	while test "" != "$1"
rather than
	while test "$1" != ""
Apparently
	test "$1" != ""
with $1 equal -t is interpreted as "check whether the next argument
(interpreted as a file descriptor) is a tty", rather than "check
the equality of the the strings -t and "".  As it happens, the
numerical value of != is 0; hence, the -t option worked correctly for
	ptroff -t file
but not for
	tbl file | ptroff -t
or
	ptroff -t < file

Ron Stanonik
stanonik@nprdc.arpa