Thread View: news.software.nn
1 messages
1 total messages
Started by Mark Rawling
Wed, 19 Feb 1992 00:26
Another patch for multi-part decoding
Author: Mark Rawling
Date: Wed, 19 Feb 1992 00:26
Date: Wed, 19 Feb 1992 00:26
46 lines
2033 bytes
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) {
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads