lwall@sdcrdcf.UUCP (Larry Wall) (10/03/84)
#!/bin/sh : make a subdirectory, cd to it, and run this through sh. echo 'If this kit is complete, "End of kit" will echo at the end' echo Extracting bug1 cat >bug1 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 1 Subject: %i and %R use old Article-I.D. line Index: intrp.c Description: Rn uses the old Article-I.D. line instead of the new Message-ID line when interpolating %i or %R. I didn't notice this before because we just now recompiled inews without the OLD header lines. Repeat-By: Just post a followup article on a system without OLD header lines. The references line will be missing the current message id, and the ATTRIBUTION line will start "In article <>..." Fix: Install either intrp.c.1-c (diff -c) by hand or intrp.c.1-e (diff -e) using ed. The -e version must be applied only to a stock revision 4.1 intrp.c. !STUFFY!FUNK! echo Extracting bug2 cat >bug2 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 2 Subject: rn may get confused about minimum article numbers Index: rcstuff.c Description: The relocate_newsgroup() routine did not correctly adjust the abs1st array, which stores minimum article numbers. This can manifest itself in several ways, such as spurious "Corrupt Xref" messages, and newsgroups that seem to be missing their articles. The problem does not show up unless you have CACHEFIRST defined, and newsgroups are added or moved to or from the beginning of the .newsrc. Repeat-By: Move or add some newsgroups to the front of your .newsrc, and then read news for a while. Sooner or later, it'll get you. Fix: Install either rcstuff.c.2-c (diff -c) by hand or rcstuff.c.2-e (diff -e) using ed. The -e version must be applied only to a stock 4.1 revision of rcstuff.c. !STUFFY!FUNK! echo Extracting bug3 cat >bug3 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 3 Subject: rn on System V--circular dependency Index: common.h Description: There is a minor problem with compiling rn on a stock System V system, in that: 1) fcntl.h isn't included unless PENDING is defined, and 2) PENDING isn't defined unless fcntl.h is included. Repeat-By: Compile the standard rn kit on a System V system. The problem will manifest itself with the message that TIOCSETP is not defined in term.c. Fix: The fix is trivial. If you have fcntl.h, include it near the beginning of common.h, before O_NDELAY is referenced. !STUFFY!FUNK! echo Extracting bug4 cat >bug4 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 4 Subject: 2.10.2 disables checkexpired() optimization. Index: rcln.c Description: Due to abs1st[ngnum] being set earlier (because its value can come from the active file in news 2.10.2), checkexpired() is never being called. This has two effects, neither of which are fatal. First, marking cross-referenced articles will take a bit longer because the average length of line in the .newsrc will be greater. This also affects the load time of the .newsrc, and if it continues over a period of time can cause rn to produce .newsrc lines that are too long for readnews to handle (though rn will). Second, expired articles will be reported as unread until the newsgroup is entered and the articles are found to be missing. Neophyte news users may be discouraged by messages that say there are 3198 unread articles in net.flame, when in fact there are only 57. Repeat-By: Get to a newsgroup in which you have expired but unread articles (you can manufacture such articles by editing your .newsrc). Compare the number of unread articles mentioned on the newsgroup selection level with the number of unread left to read on the first line of the first article in the newsgroup. The latter number should be 1 less than the former number. If not, you have the problem. Fix: Install either the rcln.c.4-c patch by hand, or the rcln.c.4-e patch using ed. The -e patch must be applied only to a stock revision 4.1 rcln.c. !STUFFY!FUNK! echo Extracting bug5 cat >bug5 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 5 Subject: Xref patch for 2.10.1 inews is wrong. Index: inews.c.1.pat Description: An older version of the inews patch for news 2.10.1 was inadvertently sent out with the kit. This causes inews to produce Xref lines that are useless to rn. Repeat-By: Examine an article produced by a version 2.10.1 inews that has the inews.c.1.pat applied. If the article has an Xref line due to posting to multiple newsgroups, it will be of the form: Xref: sysname art# art# art# ... This is an old form of Xref line, where the article numbers correspond to the newsgroups on the Newsgroups: line. This is now incorrect, and rn (version 4.1, anyway) will ignore such a line, and show the given article more than once. The problem with the old format was that it did not allow for possible newsgroup aliasing. Fix: The correct format of an Xref line is now: Xref: sysname newsgroup:art# newsgroup:art# ... There are 2 possible solutions: 1) Instead of applying the inews.c.1.pat that came with the rn kit, apply inews.c.5-c. 2) Upgrade to news 2.10.2 and install inews.c.2.pat from the kit. !STUFFY!FUNK! echo Extracting bug6 cat >bug6 <<'!STUFFY!FUNK!' System: rn version 4.1 Bug #: 6 Subject: articles saved to mailbox start with "From: " instead of "From ". Index: common.h Description: The format of MBOXSAVER causes articles saved in "mailbox" format to start with a From line with a colon, which confuses mailers. Repeat-By: Save an article in mailbox format. If it starts with "From: " you have the problem. Fix: Edit common.h, and remove the colons from the "From:"'s in both definitions of MBOXSAVER. !STUFFY!FUNK! echo Extracting inews.c.5-c cat >inews.c.5-c <<'!STUFFY!FUNK!' *** inews.c.1.std Tue Oct 2 16:09:59 1984 --- inews.c.1 Fri Sep 21 14:50:49 1984 *************** *** 483,488 /* * Link ARTICLE into dir for ngname and update active file. */ localize(ngname) char *ngname; { --- 483,491 ----- /* * Link ARTICLE into dir for ngname and update active file. */ + #ifdef DOXREFS + long + #endif localize(ngname) char *ngname; { *************** *** 515,520 } for (;;) { sprintf(bfr, "%s/%ld", dirname(ngname), ngsize+1); if (link(ARTICLE, bfr) == 0) break; e = errno; /* keep log from clobbering it */ fprintf(stderr, "Cannot install article as %s\n", bfr); --- 518,528 ----- } for (;;) { sprintf(bfr, "%s/%ld", dirname(ngname), ngsize+1); + #ifdef LINKART + if (mylink(ARTICLE, bfr) == 0) break; + /* on first file inits ARTICLE, on subsequent */ + /* files "links" to first article */ + #else if (link(ARTICLE, bfr) == 0) break; #endif e = errno; /* keep log from clobbering it */ *************** *** 516,521 for (;;) { sprintf(bfr, "%s/%ld", dirname(ngname), ngsize+1); if (link(ARTICLE, bfr) == 0) break; e = errno; /* keep log from clobbering it */ fprintf(stderr, "Cannot install article as %s\n", bfr); log("Cannot install article as %s", bfr); --- 524,530 ----- /* files "links" to first article */ #else if (link(ARTICLE, bfr) == 0) break; + #endif e = errno; /* keep log from clobbering it */ fprintf(stderr, "Cannot install article as %s\n", bfr); log("Cannot install article as %s", bfr); *************** *** 542,547 strcpy(firstbufname, bfr); sprintf(bfr, "%s/%ld ", ngname, ngsize+1); addhist(bfr); return TRUE; } --- 551,557 ----- strcpy(firstbufname, bfr); sprintf(bfr, "%s/%ld ", ngname, ngsize+1); addhist(bfr); + #ifndef DOXREFS return TRUE; #else DOXREFS return ngsize+1; *************** *** 543,548 sprintf(bfr, "%s/%ld ", ngname, ngsize+1); addhist(bfr); return TRUE; } /* --- 553,561 ----- addhist(bfr); #ifndef DOXREFS return TRUE; + #else DOXREFS + return ngsize+1; + #endif DOXREFS } /* *************** *** 553,558 register char *ptr; register FILE *tfp; int badgroup = 0, goodgroup = 0; /* Fill up the rest of header. */ if (mode != PROC) { --- 566,574 ----- register char *ptr; register FILE *tfp; int badgroup = 0, goodgroup = 0; + #ifdef DOXREFS + register char *nextxref = header.xref; + #endif DOXREFS /* Fill up the rest of header. */ if (mode != PROC) { *************** *** 565,570 if (mode==PROC) log("from %s relay %s", header.from, header.relayversion); /* Write article to temp file. */ tfp = xfopen(mktemp(ARTICLE), "w"); lhwrite(&header, tfp); --- 581,593 ----- if (mode==PROC) log("from %s relay %s", header.from, header.relayversion); + #ifdef LINKART + *ARTICLE = '\0'; /* tell mylink() to snarf the name */ + #else !LINKART + #ifdef DOXREFS + /* Open temp file for article, but link before writing */ + tfp = xfopen(mktemp(ARTICLE), "w"); + #else DOXREFS /* Write article to temp file. */ tfp = xfopen(mktemp(ARTICLE), "w"); lhwrite(&header, tfp); *************** *** 577,582 } fclose(tfp); fclose(infp); if (is_ctl) { control(&header); --- 600,607 ----- } fclose(tfp); fclose(infp); + #endif DOXREFS + #endif LINKART if (is_ctl) { control(&header); *************** *** 593,598 } } } else { for (ptr = nbuf; *ptr;) { if (*ptr == '-') { while (*ptr++) --- 618,627 ----- } } } else { + #ifdef DOXREFS + sprintf(nextxref,"%s ",SYSNAME); + nextxref += strlen(nextxref); + #endif for (ptr = nbuf; *ptr;) { if (*ptr == '-') { while (*ptr++) *************** *** 610,615 } else goodgroup++; if (*nbuf) localize(ptr); while (*ptr++) --- 639,645 ----- } else goodgroup++; + #ifndef DOXREFS if (*nbuf) localize(ptr); #else DOXREFS *************** *** 612,617 goodgroup++; if (*nbuf) localize(ptr); while (*ptr++) ; } --- 642,653 ----- #ifndef DOXREFS if (*nbuf) localize(ptr); + #else DOXREFS + if (*nbuf) + sprintf(nextxref,"%s:%ld ",ptr,localize(ptr)); + while (*nextxref) + nextxref++; + #endif DOXREFS while (*ptr++) ; } *************** *** 616,621 ; } } #ifdef NOFORWARD if (*nbuf) --- 652,663 ----- ; } } + #ifdef DOXREFS + if (goodgroup < 2 || badgroup) + header.xref[0] = '\0'; + else + *(nextxref-1) = '\0'; + #endif #ifdef LINKART tfp = xfopen(ARTICLE,"w"); /* open 1st article localized */ *************** *** 617,622 } } #ifdef NOFORWARD if (*nbuf) #endif --- 659,683 ----- *(nextxref-1) = '\0'; #endif + #ifdef LINKART + tfp = xfopen(ARTICLE,"w"); /* open 1st article localized */ + #endif + + #if defined(LINKART) || defined(DOXREFS) + /* Now that xref is constructed, write article to temp file. */ + /* (We ought to detect no room at this point and clean up.) */ + lhwrite(&header, tfp); + while (fgets(bfr, BUFLEN, infp) != NULL) { + /* + if (!strncmp(bfr, "From ", 5)) + putc('>', tfp); + */ + fputs(bfr, tfp); + } + fclose(tfp); + fclose(infp); + #endif LINKART || DOXREFS + #ifdef NOFORWARD if (*nbuf) #endif *************** *** 861,863 mclose(fd); } } --- 922,946 ----- mclose(fd); } } + + #ifdef LINKART + mylink(tmpart,linkfrom) + char *tmpart, *linkfrom; + { + struct stat statbuf; + + if (stat(linkfrom,&statbuf)==0) + return -1; + if (!*tmpart) + strcpy(tmpart,linkfrom); + else { + FILE *linkfp = fopen(linkfrom,"w"); + + if (!linkfp) + return -1; + fprintf(linkfp,"%s\n",tmpart); + fclose(linkfp); + } + return 0; + } + #endif LINKART !STUFFY!FUNK! echo Extracting intrp.c.1-c cat >intrp.c.1-c <<'!STUFFY!FUNK!' *** /tmp/,RCSt1014172 Tue Sep 25 14:12:06 1984 --- /tmp/,RCSt2014172 Tue Sep 25 14:12:16 1984 *************** *** 1,4 ! /* $Header: intrp.c,v 4.1 84/09/24 11:57:13 lwall Exp $ * * $Log: intrp.c,v $ * Revision 4.1 84/09/24 11:57:13 lwall --- 1,4 ----- ! /* $Header: intrp.c,v 4.1.1.2 84/09/25 14:02:08 lwall Exp $ * * $Log: intrp.c,v $ * Revision 4.1.1.2 84/09/25 14:02:08 lwall *************** *** 1,6 /* $Header: intrp.c,v 4.1 84/09/24 11:57:13 lwall Exp $ * * $Log: intrp.c,v $ * Revision 4.1 84/09/24 11:57:13 lwall * Real baseline. * --- 1,12 ----- /* $Header: intrp.c,v 4.1.1.2 84/09/25 14:02:08 lwall Exp $ * * $Log: intrp.c,v $ + * Revision 4.1.1.2 84/09/25 14:02:08 lwall + * %i used ARTID_LINE, should be MESSID_LINE. + * + * Revision 4.1.1.1 84/09/25 13:22:59 lwall + * Branch for sdcrdcf changes. + * * Revision 4.1 84/09/24 11:57:13 lwall * Real baseline. * *************** *** 489,495 break; case 'i': if (!(s=artid_buf)) ! s = artid_buf = fetchlines(art,ARTID_LINE); if (*s != '<') { sprintf(scrbuf,"<%s>",artid_buf); s = scrbuf; --- 495,501 ----- break; case 'i': if (!(s=artid_buf)) ! s = artid_buf = fetchlines(art,MESSID_LINE); if (*s != '<') { sprintf(scrbuf,"<%s>",artid_buf); s = scrbuf; *************** *** 566,572 else *scrbuf = '\0'; if (!artid_buf) ! artid_buf = fetchlines(art,ARTID_LINE); if (artid_buf[0] == '<') safecat(scrbuf,artid_buf,sizeof(scrbuf)); else { --- 572,578 ----- else *scrbuf = '\0'; if (!artid_buf) ! artid_buf = fetchlines(art,MESSID_LINE); if (artid_buf[0] == '<') safecat(scrbuf,artid_buf,sizeof(scrbuf)); else { !STUFFY!FUNK! echo Extracting intrp.c.1-e sed >intrp.c.1-e <<'!STUFFY!FUNK!' -e 's/X//' X569c X artid_buf = fetchlines(art,MESSID_LINE); X. X492c X s = artid_buf = fetchlines(art,MESSID_LINE); X. X3a X * Revision 4.1.1.2 84/09/25 14:02:08 lwall X * %i used ARTID_LINE, should be MESSID_LINE. X * X * Revision 4.1.1.1 84/09/25 13:22:59 lwall X * Branch for sdcrdcf changes. X * X. X1c X/* $Header: intrp.c,v 4.1.1.2 84/09/25 14:02:08 lwall Exp $ X. !STUFFY!FUNK! echo Extracting rcln.c.4-c cat >rcln.c.4-c <<'!STUFFY!FUNK!' *** /tmp/,RCSt1002003 Wed Sep 26 09:32:29 1984 --- /tmp/,RCSt2002003 Wed Sep 26 09:32:35 1984 *************** *** 1,4 ! /* $Header: rcln.c,v 4.1 84/09/24 12:04:36 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.1 84/09/24 12:04:36 lwall --- 1,4 ----- ! /* $Header: rcln.c,v 4.1.1.2 84/09/25 17:20:55 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.1.1.2 84/09/25 17:20:55 lwall *************** *** 1,6 /* $Header: rcln.c,v 4.1 84/09/24 12:04:36 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.1 84/09/24 12:04:36 lwall * Real baseline. * --- 1,13 ----- /* $Header: rcln.c,v 4.1.1.2 84/09/25 17:20:55 lwall Exp $ * * $Log: rcln.c,v $ + * Revision 4.1.1.2 84/09/25 17:20:55 lwall + * Getting abs1st from active file before calling checkexpired caused + * checkexpired to not get called. + * + * Revision 4.1.1.1 84/09/25 13:25:34 lwall + * Branch for sdcrdcf changes. + * * Revision 4.1 84/09/24 12:04:36 lwall * Real baseline. * *************** *** 322,327 char tmpbuf[64], *mybuf = tmpbuf; char *nums; int length; ART_NUM ngsize = getngsize(ngnum); ART_NUM unread = ngsize; ART_NUM newmax; --- 329,337 ----- char tmpbuf[64], *mybuf = tmpbuf; char *nums; int length; + #ifdef CACHEFIRST + bool virgin_ng = (!abs1st[ngnum]); + #endif ART_NUM ngsize = getngsize(ngnum); ART_NUM unread = ngsize; ART_NUM newmax; *************** *** 336,342 return; } #ifdef CACHEFIRST ! if (!abs1st[ngnum]) #else if (!toread[ngnum]) #endif --- 346,352 ----- return; } #ifdef CACHEFIRST ! if (virgin_ng) #else if (!toread[ngnum]) #endif !STUFFY!FUNK! echo Extracting rcln.c.4-e sed >rcln.c.4-e <<'!STUFFY!FUNK!' -e 's/X//' X339c X if (virgin_ng) X. X324a X#ifdef CACHEFIRST X bool virgin_ng = (!abs1st[ngnum]); X#endif X. X3a X * Revision 4.1.1.2 84/09/25 17:20:55 lwall X * Getting abs1st from active file before calling checkexpired caused X * checkexpired to not get called. X * X * Revision 4.1.1.1 84/09/25 13:25:34 lwall X * Branch for sdcrdcf changes. X * X. X1c X/* $Header: rcln.c,v 4.1.1.2 84/09/25 17:20:55 lwall Exp $ X. !STUFFY!FUNK! echo Extracting rcstuff.c.2-c cat >rcstuff.c.2-c <<'!STUFFY!FUNK!' *** /tmp/,RCSt1014132 Tue Sep 25 14:10:40 1984 --- /tmp/,RCSt2014132 Tue Sep 25 14:11:02 1984 *************** *** 1,4 ! /* $Header: rcstuff.c,v 4.1 84/09/24 12:05:08 lwall Exp $ * * $Log: rcstuff.c,v $ * Revision 4.1 84/09/24 12:05:08 lwall --- 1,4 ----- ! /* $Header: rcstuff.c,v 4.1.1.2 84/09/25 13:58:26 lwall Exp $ * * $Log: rcstuff.c,v $ * Revision 4.1.1.2 84/09/25 13:58:26 lwall *************** *** 1,6 /* $Header: rcstuff.c,v 4.1 84/09/24 12:05:08 lwall Exp $ * * $Log: rcstuff.c,v $ * Revision 4.1 84/09/24 12:05:08 lwall * Real baseline. * --- 1,13 ----- /* $Header: rcstuff.c,v 4.1.1.2 84/09/25 13:58:26 lwall Exp $ * * $Log: rcstuff.c,v $ + * Revision 4.1.1.2 84/09/25 13:58:26 lwall + * Oops, relocate_newsgroup() didn't relocate abs1st[]. One of these years + * I'll make the newsgroup entry a struct... + * + * Revision 4.1.1.1 84/09/25 13:25:43 lwall + * Branch for sdcrdcf changes. + * * Revision 4.1 84/09/24 12:05:08 lwall * Real baseline. * *************** *** 389,394 #ifdef DEBUGGING ART_NUM tmpngmax; #endif starthere = 0; /* Disable this optimization */ writesoft = TRUE; /* Update soft pointer file */ --- 396,404 ----- #ifdef DEBUGGING ART_NUM tmpngmax; #endif + #ifdef CACHEFIRST + ART_NUM tmpabs1st; + #endif starthere = 0; /* Disable this optimization */ writesoft = TRUE; /* Update soft pointer file */ *************** *** 409,414 #ifdef DEBUGGING tmpngmax = ngmax[ngx]; #endif for (i=ngx+1; i<nextrcline; i++) { rcline[i-1] = rcline[i]; toread[i-1] = toread[i]; --- 419,427 ----- #ifdef DEBUGGING tmpngmax = ngmax[ngx]; #endif + #ifdef CACHEFIRST + tmpabs1st = abs1st[ngx]; + #endif for (i=ngx+1; i<nextrcline; i++) { rcline[i-1] = rcline[i]; toread[i-1] = toread[i]; *************** *** 418,423 #ifdef DEBUGGING ngmax[i-1] = ngmax[i]; #endif } rcline[nextrcline-1] = tmprcline; toread[nextrcline-1] = tmptoread; --- 431,439 ----- #ifdef DEBUGGING ngmax[i-1] = ngmax[i]; #endif + #ifdef CACHEFIRST + abs1st[i-1] = abs1st[i]; + #endif } rcline[nextrcline-1] = tmprcline; toread[nextrcline-1] = tmptoread; *************** *** 427,432 #ifdef DEBUGGING ngmax[nextrcline-1] = tmpngmax; #endif } if (current_ng > ngx) current_ng--; --- 443,451 ----- #ifdef DEBUGGING ngmax[nextrcline-1] = tmpngmax; #endif + #ifdef CACHEFIRST + abs1st[nextrcline-1] = tmpabs1st; + #endif } if (current_ng > ngx) current_ng--; *************** *** 545,550 #ifdef DEBUGGING tmpngmax = ngmax[nextrcline-1]; #endif for (i=nextrcline-2; i>=newng; i--) { rcline[i+1] = rcline[i]; toread[i+1] = toread[i]; --- 564,572 ----- #ifdef DEBUGGING tmpngmax = ngmax[nextrcline-1]; #endif + #ifdef CACHEFIRST + tmpabs1st = abs1st[nextrcline-1]; + #endif for (i=nextrcline-2; i>=newng; i--) { rcline[i+1] = rcline[i]; toread[i+1] = toread[i]; *************** *** 554,559 #ifdef DEBUGGING ngmax[i+1] = ngmax[i]; #endif } rcline[newng] = tmprcline; toread[newng] = tmptoread; --- 576,584 ----- #ifdef DEBUGGING ngmax[i+1] = ngmax[i]; #endif + #ifdef CACHEFIRST + abs1st[i+1] = abs1st[i]; + #endif } rcline[newng] = tmprcline; toread[newng] = tmptoread; *************** *** 562,567 softptr[newng] = tmpsoftptr; #ifdef DEBUGGING ngmax[newng] = tmpngmax; #endif } if (current_ng >= newng) --- 587,595 ----- softptr[newng] = tmpsoftptr; #ifdef DEBUGGING ngmax[newng] = tmpngmax; + #endif + #ifdef CACHEFIRST + abs1st[newng] = tmpabs1st; #endif } if (current_ng >= newng) !STUFFY!FUNK! echo Extracting rcstuff.c.2-e sed >rcstuff.c.2-e <<'!STUFFY!FUNK!' -e 's/X//' X564a X#endif X#ifdef CACHEFIRST X abs1st[newng] = tmpabs1st; X. X556a X#ifdef CACHEFIRST X abs1st[i+1] = abs1st[i]; X#endif X. X547a X#ifdef CACHEFIRST X tmpabs1st = abs1st[nextrcline-1]; X#endif X. X429a X#ifdef CACHEFIRST X abs1st[nextrcline-1] = tmpabs1st; X#endif X. X420a X#ifdef CACHEFIRST X abs1st[i-1] = abs1st[i]; X#endif X. X411a X#ifdef CACHEFIRST X tmpabs1st = abs1st[ngx]; X#endif X. X391a X#ifdef CACHEFIRST X ART_NUM tmpabs1st; X#endif X. X3a X * Revision 4.1.1.2 84/09/25 13:58:26 lwall X * Oops, relocate_newsgroup() didn't relocate abs1st[]. One of these years X * I'll make the newsgroup entry a struct... X * X * Revision 4.1.1.1 84/09/25 13:25:43 lwall X * Branch for sdcrdcf changes. X * X. X1c X/* $Header: rcstuff.c,v 4.1.1.2 84/09/25 13:58:26 lwall Exp $ X. !STUFFY!FUNK! echo "" echo "End of kit" : I do not append .signature, but someone might mail this. exit