[net.news.b] 2.10.1 saves news with date 0 -- bug and fix

puder@burdvax.UUCP (09/20/83)

I noticed that saved news had Dec 31 19:00:00 1969 on it, so I went in
looking for a zero.  I found that the internal header record has a subtime
field (corresponding to subdate) that is used but never set.  I fixed this
with getdate, and did the same for exptime and rectime.  Here is the diff:

% rcsdiff -c2 -r1.1 -r1.2 header.c
RCS file: RCS/header.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c2 -r1.1 -r1.2
*** /tmp/,RCSt1023482	Mon Sep 19 17:27:38 1983
--- /tmp/,RCSt2023482	Mon Sep 19 17:27:44 1983
***************
*** 59,62
  	if (!nstrip(hp->subdate))
  		return(NULL);
  	hfgets(hp->title, BUFLEN, fp);		/* title */
  	if (!nstrip(hp->title))

--- 59,64 -----
  	if (!nstrip(hp->subdate))
  		return(NULL);
+ 				/* fill in subtime * puder 9/19/83 */
+ 	hp->subtime = getdate(hp->subdate, (struct timeb *) NULL);
  	hfgets(hp->title, BUFLEN, fp);		/* title */
  	if (!nstrip(hp->title))
***************
*** 144,147
  		case SUBMIT:
  			getfield(hp->subdate);
  			break;
  		case RECEIVE:

--- 146,151 -----
  		case SUBMIT:
  			getfield(hp->subdate);
+ 			hp->subtime = getdate(hp->subdate,
+ 				(struct timeb *) NULL);/* puder 9/19/83 */
  			break;
  		case RECEIVE:
***************
*** 147,150
  		case RECEIVE:
  			getfield(hp->recdate);
  			break;
  		case EXPIRE:

--- 151,156 -----
  		case RECEIVE:
  			getfield(hp->recdate);
+ 			hp->rectime = getdate(hp->recdate,
+ 				(struct timeb *) NULL);/* puder 9/19/83 */
  			break;
  		case EXPIRE:
***************
*** 150,153
  		case EXPIRE:
  			getfield(hp->expdate);
  			break;
  		case ARTICLEID:

--- 156,161 -----
  		case EXPIRE:
  			getfield(hp->expdate);
+ 			hp->exptime = getdate(hp->expdate,
+ 				(struct timeb *) NULL);/* puder 9/19/83 */
  			break;
  		case ARTICLEID:

++++++++++++++++
These last two differences are not real, they are (apparently) a bug in
rcsdiff.  Has anybody else seen this behavior?

***************
*** 554,558
  		*--tp = '\0';	/* clobber newline */
  
! 	while ((c = getc(fp)) == ' ' || c == '\t') {	/* for each cont line */
  		/* Continuation line. */
  		while ((c = getc(fp)) == ' ' || c == 't')	/* skip white space */

--- 562,568 -----
  		*--tp = '\0';	/* clobber newline */
  
! 	while ((c = getc(fp)) == ' ' || c == '\t') {	/* f[1] 23491
! [1]    Done                 /usr/adm/RCSLOG/bin/snoop  ...
! or each cont line */
  		/* Continuation line. */
  		while ((c = getc(fp)) == ' ' || c == 't')	/* skip white space */
***************
*** 566,570
  	if (c != EOF)
  		ungetc(c, fp);	/* push back first char of next header */
! 	return c[1] 23487
! p;
  }

--- 576,579 -----
  	if (c != EOF)
  		ungetc(c, fp);	/* push back first char of next header */
! 	return cp;
  }
8.1u 4.6s 0:37 34% 35+18k 174+78io 29pf+0w
%