From dmtech@magi.com Thu Sep 14 13:21:57 EDT 1995
Article: 13964 of news.software.nntp
Path: news.math.psu.edu!news.cac.psu.edu!news.tc.cornell.edu!travelers.mail.cornell.edu!news.kei.com!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!in2.uu.net!fonorola!news.magi.com!infoweb.magi.com!dmtech
From: dmtech@magi.com (Andrew Mileski)
Newsgroups: news.software.nntp
Subject: INN 1.4sec - Bug Fix for nnrpd NEWNEWS
Date: 13 Sep 1995 15:57:07 GMT
Organization: Magi Data Consulting
Lines: 74
Distribution: inet
Message-ID: <436v0j$c1i@news.magi.com>
NNTP-Posting-Host: infoweb.magi.com
Summary: NEWNEWS Distribution bug fix
Keywords: inn nnrpd newnews distribution bug fix patch
X-Newsreader: TIN [version 1.2 PL2]

The following is a copy of my E-mail to Rich $alz. He has aknowledged it
("wow, amazing nobody noticed it before. tnx."), so I'm posting this for
everyone to scrutinize and pick apart :)

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Hello!

    Patch 1 is cosmetic. Patch 2 is the following:

    NEWNEWS newsgroups yymmdd hhmmss ["GMT"] [<distributions>]

    Distributions were broken in INN 1.4sec...not any more! The code used to
wrongly open & scan directories, not files, for distribution headers. Also
the headers were never recognized, because they were compared against the
file name and not the word 'distribution'. Gosh this is slow; there must be
a better way.

    Patch below is meant to be applied from the top of the source tree.

    Do I get my name on anything for this? :)

   Phew! Now I can get back to the *real* work at hand: NNTP extension
for reading compressed batches (XGETBATCH). Death to "slurp"! If you are
interested, or already have something similar, let me know.

BEGIN --- CUT HERE --- CUT HERE ---
--- nnrpd/nnrpd.c	Wed Sep 13 00:43:13 1995
@@ -112,7 +112,7 @@
     {	"xpat",		CMDxpat,	FALSE,	4,	CMDany,
 	"header range|MessageID pat [morepat...]" },
     {	"xpath",	CMDxpath,	FALSE,	2,	2,
-	"xpath MessageID" },
+	"MessageID" },
 #if	defined(DO_DO_XTHREAD)
     {	"xthread",	CMDxthread,	FALSE,	1,	2,
 	"[dbinit|thread]" },
--- nnrpd/newnews.c	Wed Sep 13 00:58:59 1995
@@ -51,7 +51,7 @@
 	if ((q = strchr(p, ':')) == NULL)
 	    continue;
 	*q = '\0';
-	if (caseEQ(buff, "distribution")) {
+	if (caseEQ(p, "distribution")) {
 	    for (q += 2, dp = distribs; *dp; dp++)
 		if (caseEQ(q, *dp)) {
 		    QIOclose(qp);
@@ -92,9 +92,10 @@
 	    size += FILE_LIST_DELTA;
 	    RENEW(list, char *, size + 1);
 	}
-	for (list[i++] = p; *p && *p != '\n' && !ISWHITE(*p); p++)
-	    if (*p == '/')
-		*p = '\0';
+	for (list[i++] = p; *p && *p != '\n' && !ISWHITE(*p); p++) {
+	    ;
+	}
+	*p = '\0';
     }
     list[i] = NULL;
     return i ? list : NULL;
END --- CUT HERE --- CUT HERE ---


-- Andrew E. Mileski --

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
There is no such thing | Dark Matter Technologies Inc. | Help support world
as a stupid question,  |    Ottawa, Ontario, Canada    | domination: send
just stupid answers.   |        dmtech@magi.com        | your paycheques to
     Asimov: Q->       |  http://www.magi.com/~dmtech/ | Microsoft or DeBeers
-----------------------------------------------------------------------------
        You should never worry about asking too many questions.
        You should worry about running out of questions to ask.
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=


