[net.news.b] inews problem needs an explanation. help?

chuqui@nsc.UUCP (Chuq Von Rospach) (04/07/84)

While delving through the innards of inews trying to figure out how to do
something, I came across the following code. Is this a remnant of a past
hack, a bug, or have I missed something?

in input() there is a check that does the following:

if (*filename) {
    tty = FALSE;
    infp = xfopen(filename,"r");
} else {
    infp = stdin;
}

[ block of code]

if (*filename)
    fclose(infp);

That is all well and good, but nowhere between the setting of infp and the
fclose() can I find a reference to infp! All input is done off of stdin in
the line:

while (!sigtrap && fgets(bfr,BUFLEN,stdin) != NULL) {

Now, the question. Is infp a leftover? should fgets be reading infp? Am I
completely crazy? My intuition tells me that the code that uses infp isn't
neccessary any more, but I'd love to have someone tell me what is really
going on. 

(For the information of those who might be considering this also, I am
attempting to hack bnproc into inews in a relatively efficient way to get
rid of all of those forks. If anyone has done this before, I'd love to hear
from them.... Helps and hints welcome, as it is turning into something a
bit more non-trivial than I'd hoped)

chuq


-- 
From under the bar at Callahan's:		Chuq Von Rospach
{amd70,fortune,hplabs,menlo70}!nsc!chuqui	(408) 733-2600 x242

A toast! To absent friends... {clink}