🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #2475

Another patch for multi-part decoding

#2475
From: Mark Rawling
Date: Wed, 19 Feb 1992 00:26
46 lines
2033 bytes
I posted a bug fix last week, but I have since added another special
case to handle a very common multi-part posting format that causes the
decoder to fail, and put it all in a proper patch. This includes the
original bug fix which is a definite boo-boo that needs fixing (the
second hunk). This has also been sent to nn-bugs for official
contemplation.


*** decode.c	Wed Feb 19 11:01:41 1992
--- decode.c.new	Wed Feb 19 11:12:45 1992
***************
*** 133,138 ****
--- 133,148 ----
  	return SKIP_TRAILING;
      }
  
+     /*
+      * Some common endings that survive to this point.
+      * Could fail if a line really started with one of these, but this
+      * is sufficiently unlikely, plus it handles lots of news post formats.
+      */
+     if (state != SKIP_LEADING &&
+ 	(strncmp(buf, "END", 3) == 0 ||
+ 	 strncmp(buf, "CUT", 3) == 0))
+ 	return SKIP_TRAILING;
+ 
      rlen = cdlen[blen];
      if (len < rlen) goto d_err;
      if (len > (rlen + 2)) goto d_err;	/* line too long */
***************
*** 253,259 ****
      register int c, n = 0;
      register char *cpt;
  
!     for (c = 0; c <= MAXCHAR; c++) chtbl[c] = -1;
  
      for (;;) {
  	if (fgets(buf, sizeof buf, in) == NULL) {
--- 263,269 ----
      register int c, n = 0;
      register char *cpt;
  
!     for (c = 0; c < MAXCHAR; c++) chtbl[c] = -1;
  
      for (;;) {
  	if (fgets(buf, sizeof buf, in) == NULL) {
Technical Details
Message-ID: <1992Feb19.002645.8274@mel.dit.csiro.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!munnari.oz.au!mel.dit.csiro.au!koel.mel.dit.csiro.au!mwr

Show Full Headers
Complete Article Headers
Message-ID: <1992Feb19.002645.8274@mel.dit.csiro.au>
Subject: Another patch for multi-part decoding
Date: Wed, 19 Feb 1992 00:26:45 +0000
From: mwr@koel.mel.dit.csiro.au (Mark Rawling)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!munnari.oz.au!mel.dit.csiro.au!koel.mel.dit.csiro.au!mwr
Newsgroups: news.software.nn
Sender: news@mel.dit.csiro.au
Organization: CSIRO DIT (Melb.)
Lines: 46