[net.sources.bugs] flame of roff in 'C' by Butler Hine

brian@ukma.UUCP (Brian Sturgill) (01/03/85)

[ The posted version of this program does not work and was apparently
[ never tested.  As posted, any request at the beginning of a text file
[ causes the whole file to be skipped because of a logic error in the
[ basic input routine, called "suck()."  It is well named.  Leading
[ spaces do not cause a line break since the logic to do this is missing.
[ Blank lines disappear.  Doubtless there are other bugs as well.
[ 
[ Pity.  Would have been useful.

While it is true that the author of the program did ignore breaks at
empty lines and space a beginning of a line, We had no problem here with
commands a the beginning of the text file.  The program in general seems to
work, and the code is easy to read.  I think the author should be congratulated
not flamed.  I for one am going to take his code and add also the MS macro
set to it.  I had wanted to do this to roff before, but it was in assembly
language, and I didn't have the time to do a translation.

Also, shouldn't flames about sources go into net.sources.bugs?
 

mwherman@watcgl.UUCP (Michael W. Herman) (01/05/85)

I, too, had problems with this when I first ran it and haven't tried it much
since.  Try using the roff C source file for input - roff.c.  The
distributed source seems to end up in an infinite loop.  I wouldn't
expect roff to do anything intelligent with C source but it should
have done something reasonable.  

When I used the new readline that Tim Maroney distributed, the problem went way.

nather@utastro.UUCP (Ed Nather) (01/08/85)

[]
The differing effects were due to compiling "roff.c" on different
compilers.  The basic input routine used the library function
"iscntrl()" which, under 4.2bsd (at least) DOES NOT consider newlines
to be control characters; it passed newlines to the program, which could
then find the ends of lines.  The manual page describes "iscntrl()"
as returning TRUE if the ASCII code is smaller than octal 40 or is
octal 177.  If these rules are applied, roff.c, as distributed, never
finds a newline after any dot-request line and fails totally.

This is clearly not the author's fault, but it IS a portability problem.
It was explained in net.lang.c, where it was greeted with massive apathy.

I owe an apology to the net for posting in net.sources, but the machine I
was on did not recognize net.sources.bugs as a legitimate newgroup.  It now
does.  I also owe the innocent graduate student Butler Hine an apology;
I used his account and posted to the net, realizing only belatedly he'd be
charged with the crime.  utastro was down at the time, for almost 2 weeks,
and I was getting withdrawal symptoms without access to netnews.

"To err is human; to forgive, impossible."

Ed Nather
{ihnp4,allegra}!{noao,ut-sally}!utastro!nather