new vn "%" listing bug

tallman at hc.UUCP tallman at hc.UUCP
Thu Feb 19 10:27:00 AEST 1987


The new feature in vn that allows one to go to a new newsgroup from the
"%" listing has a bug.  If the user mistypes the newsgroup number and
chooses a group that has no news in it the program aborts with "bad
temp file read".  The following patch should make it recover gracefully.

*** vn.c	Wed Feb 18 17:04:25 1987
--- vn.c.new	Wed Feb 18 17:07:37 1987
***************
*** 1188,1193 ****
--- 1188,1194 ----
  		printf("n - new group, other to return ... ");
  		c = getnoctl();
  	}
+ 	retry:
  	if (c == 'n')
  	{
  		printf("\n");
***************
*** 1197,1204 ****
  			i = 0;
  		if (i >= Ncount)
  			i = Ncount-1;
! 		find_page((Newsorder[i])->pnum);
! 		*rec = RECBIAS;
! 		*hirec = Page.h.artnum + RECBIAS;
  	}
  }
--- 1198,1213 ----
  			i = 0;
  		if (i >= Ncount)
  			i = Ncount-1;
! 		if ((Newsorder[i])->pages == 0) {
! 			printf("\nNo news was read for that group\n");
! 			printf("n - new group, other to return ... ");
! 			c = getnoctl();
! 			goto retry;
! 		}
! 		else {
! 			find_page((Newsorder[i])->pnum);
! 			*rec = RECBIAS;
! 			*hirec = Page.h.artnum + RECBIAS;
! 		}
  	}
  }
-- 
Dave Tallman - tallman at hc.arpa  or  ihnp4!lanl!hc!tallman
Los Alamos National Laboratory - E-10/Data Systems
Los Alamos, New Mexico  -  (505) 667-8495



More information about the Comp.sources.bugs mailing list