Minor bug in readnews

Superuser root at aaec.OZ
Wed Nov 13 19:31:10 AEST 1985


Description:
	If there are a number of missing directories for newsgroups
	mentioned in the active file then "readnews" prints the message

		Can't open <directory>

	at seemingly random times when listing headers or skipping
	newsgroups.  This is despite the fact that there are no articles
	currently in the indicated newsgroup.  (i.e. the lower bound
	equals the upper bound.)

	(News version: B 2.10.3 alpha 4/15/85, although the problem
	is also in B 2.10.2 and, I suspect, even earlier versions)

Repeat-by:
	After deleting all the empty directories in /usr/spool/news
	run
		readnews -x -l > /dev/null

	and watch the errors reported.

Diagnosis:
	This is caused by not reseting the variable "noaccess" on
	entry to a new newsgroup (i.e. directory).  So on the
	third missing directory in a row it prints the message.
	(It's incremented twice for each missing directory!)

Fix-by:
	Adding the following patch to the function "readr".
	(Actually a lot of the code around here could be rewritten
	to check the newsgroup bound more efficiently.)

*** readr.c.old	Tue Jun  4 05:53:54 1985
--- readr.c	Wed Nov 13 19:37:13 1985
***************
*** 982,993
  				if (!xflag)
  					fprintf(stderr,"[Saving .newsrc]\n");
  				writeoutrc();
  				timelastsaved = now;
  			}
  		}
  	}
  
  nextart2:
  #ifdef DEBUG
  	fprintf(stderr, "article: %s/%ld\n", groupdir, bit);
  #endif

--- 982,994 -----
  				if (!xflag)
  					fprintf(stderr,"[Saving .newsrc]\n");
  				writeoutrc();
  				timelastsaved = now;
  			}
  		}
+ 		noaccess = 0;
  	}
  
  nextart2:
  #ifdef DEBUG
  	fprintf(stderr, "article: %s/%ld\n", groupdir, bit);
  #endif

-----
Frank Crawford

ACSnet:	root at aaec.OZ
UUCP:	{seismo,mcvax,ukc,prlb2,ubc-vision}!munnari!aaec.OZ!root

Australian Atomic Energy Commission		Phone: +61 2 543 3094
Private Mailbag,
SUTHERLAND,
N.S.W.  2232
Australia.



More information about the Net.bugs mailing list