Minor bug in readnews

Jim Rees rees at apollo.uucp
Tue Nov 19 01:42:52 AEST 1985


That isn't the only thing wrong with getnextart().  It doesn't work well
when you have a new active file (because you just installed news), it writes
out newsrc even with the -x flag, and it fills up errlog with one-line,
1000-byte messages when the spool directory isn't available.

Here are some fixes for these problems.

***************
*** 909,914
  			} else
  				if (rfq++ || pflag || cflag)
  					return 1;
  		}
  		if (rflag)
  			bit = ngsize + 1;

--- 927,933 -----
  			} else
  				if (rfq++ || pflag || cflag)
  					return 1;
+ 			break;
  		}
  		if (rflag)
  			bit = ngsize + 1;
***************
*** 914,920
  			bit = ngsize + 1;
  		else
  			bit = minartno - 1;
! 		if (uflag) {
  			time_t now;
  			(void) time(&now);
  			if (now - timelastsaved > 5*60 /* 5 minutes */) {

--- 933,939 -----
  			bit = ngsize + 1;
  		else
  			bit = minartno - 1;
! 		if (uflag && !xflag) {
  			time_t now;
  			(void) time(&now);
  			if (now - timelastsaved > 5*60 /* 5 minutes */) {
***************
*** 950,956
  	fprintf(stderr, "filename = '%s'\n", filename);
  #endif
  	/* Decide if we want to show this article. */
!  	if ((fp = fopen(filename, "r")) == NULL) {
   		/* since there can be holes in legal article numbers, */
   		/* we wait till we hit 5 consecutive bad articles */
   		/* before we haul off and scan the directory */

--- 970,997 -----
  	fprintf(stderr, "filename = '%s'\n", filename);
  #endif
  	/* Decide if we want to show this article. */
!  	if (bit <= 0 || (fp = fopen(filename, "r")) == NULL) {
   		/* since there can be holes in legal article numbers, */
   		/* we wait till we hit 5 consecutive bad articles */
   		/* before we haul off and scan the directory */
***************
*** 960,966
   		dirp = opendir(dirname(groupdir));
   		if (dirp == NULL) {
  			if (errno != EACCES)
! 				fprintf(stderr,"Can't open %s", dirname(groupdir));
   			goto badart;
   		}
   		nextnum = rflag ? minartno - 1 : ngsize + 1;

--- 1001,1007 -----
   		dirp = opendir(dirname(groupdir));
   		if (dirp == NULL) {
  			if (errno != EACCES)
! 				fprintf(stderr,"Can't open %s\n", dirname(groupdir));
   			goto badart;
   		}
   		nextnum = rflag ? minartno - 1 : ngsize + 1;



More information about the Net.bugs mailing list