[net.news.b] Fix to recnews.c

stein@fortune.UUCP (Mark Stein) (02/22/84)

The 2.10 version of recnews does not properly receive messages containing
header continuation lines adhering to RFC822.  Recnews (as distributed)
assumes that the continuation line starts with a space, and that the
previous header line ended with a comma.  RFC822 merely says that the
continuation line starts with white space (tab or space).

In particular, the second line of the sendmail "Received:" header line
is getting swallowed.  Recnews assumes that this line is the start of
text.  And, since the real subject header line has not been reached,
this first "text" line is taken as the subject.  This explains why
there are articles posted with subject lines consisting of sendmail
message ids.

Following is a fix.

			Mark Stein, Fortune Systems
			{ihnp4,cbosgd,harpo,amd70,sri-unix}!fortune!stein


*** recnews.c-	Tue Feb 21 14:54:48 1984
--- recnews.c	Sat Feb 11 19:34:58 1984
***************
*** 217,228
  	static char lastcomma=0;	/* prev line ended in a comma */
  	int thiscomma;
  
  	thiscomma = (p[strlen(p)-2] == ',');
  	if (*p == ' ' && lasthdr && lastcomma)
  		itsa(HEADER);		/* continuation line */
  	firstbl = any(p, " \t");
  	while (*p == ' ' || *p == '?' || *p == '\t')
  		++p;
  
  	if (*p == '\n' || *p == 0)
  		itsa(BLANK);

--- 218,233 -----
  	int thiscomma;
  
  	thiscomma = (p[strlen(p)-2] == ',');
+ #ifdef OLDCONTINUE
  	if (*p == ' ' && lasthdr && lastcomma)
  		itsa(HEADER);		/* continuation line */
+ #else  OLDCONTINUE
+ 	if ((*p == ' ' || *p == '\t') && lasthdr)
+               itsa(HEADER);           /* RFC822 continuation line */
+ #endif OLDCONTINUE
  	firstbl = any(p, " \t");
  	while (*p == ' ' || *p == '?' || *p == '\t')
  		++p;
  
  	if (*p == '\n' || *p == 0)
  		itsa(BLANK);