Article View: news.software.nntp
Article #11019BugFix - was: A patch for INN to stop sending unwanted newsgroups
From: John T. Stapleton
Date: Fri, 20 Sep 1996 00:00
Date: Fri, 20 Sep 1996 00:00
64 lines
2851 bytes
2851 bytes
Here is a bug fix for a patch which I posted on 16-May-1996. The
patch was for INN to stop sending unwanted newsgroups to downstream
neighbors by prefixing newsgroups with a double exclamation mark (!!).
Since then the patch has been completely rewritten to use a single
atsign (@), and has been converted to INN 1.5.
The Message-ID of the original was <4ngqoq$q1o@blazing.mro.dec.com>
which I put in the references header.
A note of warning to people who grab patches off DejaNews. Your
browser is probably clipping off spaces at the end of a line. Well
guess what! Context diffs rely on things like "+ " at the beginning
of a line to mean add this line, "! " to mean change this line, and so
forth. If a patch contains blank lines, they can show up in the
article as a single line starting with "+" and ending with space. The
space will get truncated thereby confusing the patch program.
It also appears that the tab characters may be converted to spaces
Apply the patch if you must, but don't criticize the author for not
lining up to the proper indentation.
Be careful when getting patches from DejaNews and which browser you
use.
Anyway here is what is wrong with my original patch:
I added an ``if'' to a ``for'' loop which did not have curly braces
wrapping the one ``if'' in the ``for'' loop. It's a pretty small fix
in newsfeeds.c.
Change the line that is marked with the ``*'' in column one by adding
the ``{'' and add the ``}'' to the end of the ``for'' loop signified
by the ``+'' in column one.
/* Now tell the groups this site gets that they should feed this site. */
if (sp != &ME && subbed) {
isp = sp - Sites;
for (p = subbed, u = unwanted, ngp = Groups, i = nGroups;
* --i >= 0; ngp++) {
if (*p++) {
for (j = 0; j < ngp->nSites; j++)
if (ngp->Sites[j] == NOSITE) {
ngp->Sites[j] = isp;
break;
}
if (j == ngp->nSites)
ngp->Sites[ngp->nSites++] = isp;
}
if (*u++) {
for (j = 0; j < ngp->nUnwant; j++)
if (ngp->Unwant[j] == NOSITE) {
ngp->Unwant[j] = isp;
break;
}
if (j == ngp->nUnwant)
ngp->Unwant[ngp->nUnwant++] = isp;
}
+ }
}
Stapes
Technical Details
Message-ID:
<51up41$192$1@ryn.mro.dec.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<4ngqoq$q1o@blazing.mro.dec.com>Show Full Headers
Complete Article Headers
Message-ID: <51up41$192$1@ryn.mro.dec.com> Subject: BugFix - was: A patch for INN to stop sending unwanted newsgroups Date: Fri, 20 Sep 1996 00:00:00 +0000 From: stapes@ryn.mro.dec.com (John T. Stapleton) References: <4ngqoq$q1o@blazing.mro.dec.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 184235013 Distribution: inet Organization: Digital Equipment Corporation - Marlboro, MA Newsgroups: news.software.nntp