2.10.2 small bug fix to header.c

Chuq chuqui at nsc.UUCP
Wed Aug 22 01:06:39 AEST 1984


This is a small bug fix to 2.10.2 header.c that fixes a problem when the
blank line between the header and the message body contains white space.
When that happens part of the message body will be added to the header and
lost to readers. I would attribute this to the original source (this is a
fairly recent 2.10.1 fix that seems to have missed the 2.10.2 release) but
my notes don't tell me where it came from. Oh, well. Whoever it was, take a
bow.

chuq

------- header.c -------
*** /tmp/d02401	Tue Aug 21 04:29:18 1984
--- header.c	Tue Aug 21 04:09:49 1984
***************
*** 566,571
  		/* Continuation line. */
  		while ((c = getc(fp)) == ' ' || c == '\t')	/* skip white space */
  			;
  		if (tp-cp < len) {*tp++ = ' '; *tp++ = c;}
  		while ((c = getc(fp)) != '\n' && c != EOF)
  			if (tp-cp < len) *tp++ = c;

--- 566,573 -----
  		/* Continuation line. */
  		while ((c = getc(fp)) == ' ' || c == '\t')	/* skip white space */
  			;
+ 		if (c == '\n') 					/* oops, really a blank line! */
+ 			break;
  		if (tp-cp < len) {*tp++ = ' '; *tp++ = c;}
  		while ((c = getc(fp)) != '\n' && c != EOF)
  			if (tp-cp < len) *tp++ = c;
-- 
>From the depths of the Crystal Cavern:		Chuq Von Rospach
{amd,decwrl,fortune,hplabs,ihnp4}!nsc!chuqui	nsc!chuqui at decwrl.ARPA

Dreams, dreams, enchanter! Gone with the harp's echo when the strings fall
mute; with the flame's shadow when the fire dies. Be still, and listen.



More information about the Comp.sources.unix mailing list