From:	ADVAX::"mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM" "William H. Glass"  6-FEB-1991 10:57:03.98
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	Re: More problems with article headers.

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Wed, 6 Feb 91 10:55:21 EST
Received:  from mcnc by ge-dab.GE.COM (5.65a+/GE-DAB 1.15) with UUCP
	id AA19529 for ; Wed, 6 Feb 91 10:12:07 -0500
Received: from VM1.NoDak.EDU by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA24391; Wed, 6 Feb 91 08:59:05 -0500
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9102061359.AA24391@mcnc.mcnc.org>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 6583; Wed, 06 Feb 91 07:58:44 CST
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 0867; Wed, 06 Feb 91 07:58:42 CST
Date:         Wed, 6 Feb 91 07:35:53 GMT
Reply-To: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Subject:      Re: More problems with article headers.
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
In article <28391.27aed9ac@kuhub.cc.ukans.edu>, sloane@kuhub.cc.ukans.edu writes
:
>
> There have been several recent articles about handling headers in ANU
> news. One problem that I have noticed is that NEWS apparently doesn't
> handle continuation of header lines correctly.  Consider the following:
>
 
example deleted.
 
> News (both V5.9 and V6.0-1) will not find a message id in the above
> article. Note that the (apparently) blank line after the Organization
> line actually contains 3 blanks.
 
1) Your analysis is correct.  NEWS is getting confused by the "blank" line
that isn't really blank.
 
2) I understand why you couldn't figure out where continuation lines are
handled.  It's definitely not one of Geoff's clearer pieces of code :-)
 
3) There are probably more problems like this lurking about.  While we're
trying to find them, I recommend installing the patch I posted to NEWSADD
a few days ago.  That will at least prevent broadcasting some junk back
to the net.
 
4) Here's a fix the the continuation line problem.  It goes into
scan_header in NEWSADD.  There's just one line to change, and 5 to delete.
This should work in 6.0-1 or 6.0-2.
 
    get_line();
    if (infile_eof || infile_eom) break;
    scan_res = (*scanline && !scan(scanline));
    if (!s_n_s && n_stripping && *add_inline == 'N') {
      c = &add_inline[1];
      do *(c - 1) = *c; while (*c++);
      }
    if (c = strchr(add_inline,'\n')) *c = '\0';
    if ((*add_inline == ' ') || (*add_inline == '\t')) {
/*      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
      if (scan_res) {
        strcat(scanline,"\n");
        append_line(scanline);
        if (c) strcat(add_inline,"\n");
        append_line(add_inline);
        scanline_m = 0;
        free(scanline);
        return(0);
        }
      else if (*scanline) ++recall;
      else {
        if (c) strcat(add_inline,"\n");
        append_line(add_inline);
        scanline_m = 0;
        free(scanline);
        return(0);
        }
 
      c = add_inline;
      while (isspace(*c)) c++;
      if (*c) {
        scanline = realloc(scanline,(scanline_m += (strlen(c) + 3)));
        strcat(scanline,c);
        }
/*      else {                          /* delete */
/*        scanline_m = 0;               /* delete */
/*        free(scanline);               /* delete */
/*        return(news_header ? 0 : recall);     /* delete */
/*        }                             /* delete */
      }
 
--
 
William H. Glass                        Internet: glass@mgi.com
Management Graphics, Inc.               Phone:    +1 (612) 854-1220
1401 E. 79th Street
Minneapolis, MN  55425
