Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 7/7/83; site rlgvax.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!ra From: ra@rlgvax.UUCP (Rick Adams) Newsgroups: net.news.b Subject: Another fix for the article truncation problem Message-ID: <1356@rlgvax.UUCP> Date: Tue, 1-Nov-83 22:29:23 EST Article-I.D.: rlgvax.1356 Posted: Tue Nov 1 22:29:23 1983 Date-Received: Fri, 4-Nov-83 03:38:22 EST Organization: CCI Office Systems Group, Reston, VA Lines: 82 As we all know by now, if an article begins with whitespace and you haven't installed the fix, the first few lines of an article are lost. The problem we have is that not all sites have installed the fix, so if someone submits an article beginning with whitespace, somewhere down the line it will probably get chopped. The solution I have installed is not to let any articles leave this machine beginning with whitespace. I insert an extra newline as the first character of the message if necessary. So, if you install the following fix to inews.c, and an article passes through your site, it will be "fixed" and not be truncated somewhere else. If enough of the major sites install this (even though they may have already installed the other fix), we can significantly reduce the number of truncated articles. Rick Adams {seismo|allegra|ihnp4}!rlgvax!ra *** inews.c.old Tue Nov 1 22:07:30 1983 --- inews.c Tue Nov 1 21:50:28 1983 *************** *** 557,562 { register char *ptr; register FILE *tfp; int badgroup = 0, goodgroup = 0; /* Fill up the rest of header. */ --- 557,563 ----- { register char *ptr; register FILE *tfp; + char c; int badgroup = 0, goodgroup = 0; /* Fill up the rest of header. */ *************** *** 572,577 /* Write article to temp file. */ tfp = xfopen(mktemp(ARTICLE), "w"); lhwrite(&header, tfp); while (fgets(bfr, BUFLEN, infp) != NULL) { /* --- 573,582 ----- /* Write article to temp file. */ tfp = xfopen(mktemp(ARTICLE), "w"); + if ( (c=getc(infp)) == ' ' || c == '\t' ) { + header.intnumlines++; + sprintf(header.numlines,"%d",header.intnumlines); + } lhwrite(&header, tfp); /* Kludge to get around article truncation problem */ if (c == ' ' || c == '\t' ) *************** *** 573,578 /* Write article to temp file. */ tfp = xfopen(mktemp(ARTICLE), "w"); lhwrite(&header, tfp); while (fgets(bfr, BUFLEN, infp) != NULL) { /* if (!strncmp(bfr, "From ", 5)) --- 578,587 ----- sprintf(header.numlines,"%d",header.intnumlines); } lhwrite(&header, tfp); + /* Kludge to get around article truncation problem */ + if (c == ' ' || c == '\t' ) + putc('\n', tfp); + putc(c,tfp); while (fgets(bfr, BUFLEN, infp) != NULL) { /* if (!strncmp(bfr, "From ", 5))