🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #7782

Re: bug for non-NNTP users

#7782
From: J. Porter Clark
Date: Thu, 08 Aug 1996 00:00
62 lines
2502 bytes
mtpins@icaen.uiowa.edu (Michael T Pins) writes:

>A number of people have reported the following:

>In db.c line 1208 reads:

>     while ( fgets(timline, sizeof timline, timfp) 

>It should read:
>while ( fgets(timline, sizeof timline, timfp) )

>This only affects those who don't use NNTP.  It's fixed in b6, but I
>figured I should let people know in the meantime.

Caught that one easily enough, but another non-NNTP error is in
libnov.c.  There's a bug in the code that causes .newsrc to be updated
even though the corresponding articles aren't read.  The bug is most
easily reproduced with the following trivial test case:

   1. Find a test newsgroup with no articles in it at all and with a
   zero-length or nonexistent .overview file.  (Good luck!  8-)

   2. Post an article to the test newsgroup.  Use a short Subject line.

   3. Use nn to read the newsgroup and update the .newsrc file.

   4. Post a second article to the test newsgroup.  Use a long Subject
   line.

   5. Use nn to read the newsgroup.  You won't see the second article,
   but .newsrc will be updated nonetheless.

Here's a quick fix similar to the one I gave Toivo Pedaste for nn-tk.
For what it's worth, I'm not really happy with the novseek() algorithm;
it seems to backtrack over work it has already done.

*** nn-6.5.0.b5/libnov.c.orig	Sun Aug  4 21:58:41 1996
--- nn-6.5.0.b5/libnov.c	Thu Aug  8 10:44:04 1996
***************
*** 156,162 ****
  	/* Seek to middle line. */
  	middle = (upper + lower) / 2;
  	(void)fseek(fp, middle, 0);
! 	while (getc(fp) != '\n' && ++middle <= upper)
  	    continue;
  
  	if (middle >= upper)
--- 156,162 ----
  	/* Seek to middle line. */
  	middle = (upper + lower) / 2;
  	(void)fseek(fp, middle, 0);
! 	while (++middle <= upper && getc(fp) != '\n')
  	    continue;
  
  	if (middle >= upper)

-- 
J. Porter Clark    jpc@drum.msfc.nasa.gov
NASA/MSFC Flight Data Systems Branch

Technical Details
Message-ID: <4udad0$dc6@hammer.msfc.nasa.gov>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!not-for-mail
References: <4ud7tv$c3f@server05.icaen.uiowa.edu>

Show Full Headers
Complete Article Headers
Message-ID: <4udad0$dc6@hammer.msfc.nasa.gov>
Subject: Re: bug for non-NNTP users
Date: Thu, 08 Aug 1996 00:00:00 +0000
From: jpc@hammer.msfc.nasa.gov (J. Porter Clark)
References: <4ud7tv$c3f@server05.icaen.uiowa.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!not-for-mail
X-Deja-AN: 172975802
Organization: NASA/MSFC
Newsgroups: news.software.nn