fix to readnews bug
utzoo!watmath!kdmoen
utzoo!watmath!kdmoen
Sun Feb 13 07:51:39 AEST 1983
Here is a fix to readnews, to fix the disappearing article bug.
[If you read an article posted to multiple newsgroups, you can't
get back to it by typing '-' or its article number]
-Doug Moen, ..!watmath!kdmoen
This replaces the seenbefore() routine starting at line 358 in rfuncs.c:
/*
* Given an article ID, return TRUE if we have already seen that article ID
* in another newsgroup. This should only be called for articles
* with commas in the newsgroup name, and prevents the same article, which
* was submitted to multiple newsgroups, from being shown to the same
* person more than once. Bug: if the user quits after seeing the first
* copy, he'll see it again next time in the other newsgroup.
/* DM modified to remember newsgroup of originally seen article,
* DM in order to alleviate the disappearing article bug
*/
#define NART 100 /* max # articles on multiple newsgroups */
#define IDSIZE 14 /* max size of an article ID */
#define NGSIZE 15 /* DM max size of a newsgroup name */
seenbefore(artid)
char *artid;
{
static int nbef = 0;
static struct {
char hb_id[IDSIZE];
char hb_ng[NGSIZE];
} histbuf[NART];
register int i;
for (i=0; i<nbef; i++)
if (strcmp(histbuf[i].hb_id, artid) == 0
&& strcmp(histbuf[i].hb_ng, groupdir) != 0)
return TRUE;
if (strlen(artid) >= IDSIZE) {
fprintf(stderr, "Article id '%s' too long\n", artid);
return FALSE;
}
if (strlen(groupdir) >= NGSIZE) {
fprintf(stderr, "Newsgroup name '%s' too long\n", groupdir);
return FALSE;
}
if (nbef >= NART-1) {
fprintf(stderr, "Too many multiple newsgroup articles\n");
return FALSE;
}
strcpy(histbuf[nbef].hb_id, artid);
strcpy(histbuf[nbef++].hb_ng, groupdir);
return FALSE;
}
More information about the Comp.sources.unix
mailing list