[news.software.notes] Patch to rs's newsinput.c

misko@ohlone (05/23/87)

In installing Rich Salz's new newsinput.c, I stumbled across a few bugs.
Here is a patch file to fix these bugs.  The newsinput.c patch is for the
new newsinput.c Rich posted a week or so ago.  The patch for expand.c is
for version 1.7.  Sorry, but the patches are in ed format.  I do not have a
diff which will do context diffs.  I think there is a public one floating
around.  If you have one, please send it to me.  Thanks.

Note that the bugs this patch fixes is for 2 problems.  One, the CRC code
was never being run.  This may have been by choice, but as Rich is in the
middle of changing jobs I cannot ask him.  The second one is a problem
where when processing a batch (newsinput -b) a newsgroup will only be
posted to a notesfile the first time it appears in that batch.  I mailed
Rich the fix and he asked me to post it as he was changing jobs.
Note that I changed the #include <sys/file.h> to #include <fcntl.h>.  I 
am running on System V, but from what I was able to check, I believe this
will also work on 4.2 systems.  Also, the patch file makes debug equal to
zero.  This cuts down on a lot of the output.

The patch file follows.

Bill Miskovetz
Cray Research
{ihnp4, lll-lcc, pyramid}!ohlone!misko
415-449-0268

-----------------------------------------------------------

Index: expand.c

215a

void init_group_list ()
{
   
   this_group = 0;
   last_group = 0;

}
.


Index: newsinput.c

833c
#endif	/* CRC_AS_ID */
.
829,830c
	    newsseq = crc32(pbuf, strlen(pbuf));
	    dprintf ("article ID: %s\nnewsseq: %lu\n", header->ident, newsseq);
.
826c
	i = sscanf (header->ident, "<%99[^@]@%99[^>]>", pbuf, field1);
.
823c
#ifdef	CRC_AS_ID
.
795c
    unsigned long    newsseq;
.
259a
    init_group_list ();
.
75c
int debug = 0;
.
17c
#include <fcntl.h>
/* #include <sys/file.h> */
.