🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #6555

Re: trn: repeated asking about new groups

#6555
From: Eiji Hirai
Date: Thu, 18 Nov 1993 00:55
81 lines
3899 bytes
: I am prompted about the same newsgroups over and over again, each time I 
: start trn.

This is caused by a bug in trn 3.3, which can be fixed by applying the patch
below my .signature.

-- 
hirai@cc.swarthmore.edu (Eiji Hirai) | Unix Geek for Swarthmore College
I don't speak for Swarthmore College | Computing Center, Swarthmore, PA, USA

"I post, therefore I am." -Rene Descartes on Usenet

From: paulr@umbc.edu (Paul Riddle)
Newsgroups: news.software.readers,news.software.nntp
Subject: Re: trn 3.3 (NNTP) triggers SunOS optimizer bug
Date: 12 Nov 1993 16:56:46 -0500
Organization: University of Maryland, Baltimore County
Message-ID: <2c10qu$saq@umbc7.umbc.edu>

I had exactly the opposite problem on my SGI..  the value in .rnlast
was several weeks in the future, and hence I wasn't getting prompted
for any new groups at all.

I traced it down to this segment of code in "nntp.c":

     ss = (*s - '0') + (*--s - '0') * 10;
     mm = (*--s - '0') + (*--s - '0') * 10;
     hh = (*--s - '0') + (*--s - '0') * 10;
     day = (*--s - '0') + (*--s - '0') * 10;
     month = (*--s - '0') + (*--s - '0') * 10;
     *s = '\0';
     year = atoi(s-4);

I might be wrong, but I wouldn't call it an optimizer bug.  The code
assumes that the left operands get evaulated before the right
operands, which ANSI C doesn't guarantee.

This patch, which basically just removes the decrement operators from
the expressions, fixed the problem for me...  Give it a shot.  (Yes I
did report it).

--------------------------------cut-------------------------------
*** nntp.c	Tue Oct 26 13:11:27 1993
--- nntp.c.orig	Tue Oct 26 12:30:48 1993
***************
*** 132,144 ****
  
      s = ser_line + strlen(ser_line) - 1;
  
!     ss = (*s - '0') + (*(s - 1) - '0') * 10;
!     mm = (*(s - 2) - '0') + (*(s - 3) - '0') * 10;
!     hh = (*(s - 4) - '0') + (*(s - 5) - '0') * 10;
!     day = (*(s - 6) - '0') + (*(s - 7) - '0') * 10;
!     month = (*(s - 8) - '0') + (*(s - 9) - '0') * 10;
!     *(s - 9) = '\0';
!     year = atoi(s-13);
  
      /* This simple algorithm will be valid until the year 2400 */
      if (year % 4)
--- 132,144 ----
  
      s = ser_line + strlen(ser_line) - 1;
  
!     ss = (*s - '0') + (*--s - '0') * 10;
!     mm = (*--s - '0') + (*--s - '0') * 10;
!     hh = (*--s - '0') + (*--s - '0') * 10;
!     day = (*--s - '0') + (*--s - '0') * 10;
!     month = (*--s - '0') + (*--s - '0') * 10;
!     *s = '\0';
!     year = atoi(s-4);
  
      /* This simple algorithm will be valid until the year 2400 */
      if (year % 4)
---------------------------cut----------------------------------


-- 
Paul Riddle                         | Internet:  paulr@umbc.edu        |
UMBC, Academic Computing Services   | Phone:  (410) 455-3860 FAX -1065 |
Baltimore, MD 21228                 +----------------------------------+
"SPARCClassic....  The Sun 3/50 of the 90's!"
Technical Details
Message-ID: <2ceh65$c0e@larch.cc.swarthmore.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!sol.ctr.columbia.edu!spool.mu.edu!olivea!sgigate.sgi.com!rutgers!netnews.upenn.edu!news.cc.swarthmore.edu!hirai
References: <2c631a$c53@hobbes.cc.uga.edu> <2c8a2n$q5n@uxa.ecn.bgu.edu> <2c8ds0$b1n@uxa.ecn.bgu.edu> <1993Nov16.174316.7938@dickens.com>

Show Full Headers
Complete Article Headers
Message-ID: <2ceh65$c0e@larch.cc.swarthmore.edu>
Subject: Re: trn: repeated asking about new groups
Date: Thu, 18 Nov 1993 00:55:33 +0000
From: hirai@cc.swarthmore.edu (Eiji Hirai)
References: <2c631a$c53@hobbes.cc.uga.edu> <2c8a2n$q5n@uxa.ecn.bgu.edu> <2c8ds0$b1n@uxa.ecn.bgu.edu> <1993Nov16.174316.7938@dickens.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!sol.ctr.columbia.edu!spool.mu.edu!olivea!sgigate.sgi.com!rutgers!netnews.upenn.edu!news.cc.swarthmore.edu!hirai
Newsgroups: news.software.readers
Organization: Computing Center, Swarthmore College, Swarthmore, PA, USA
Lines: 81
NNTP-Posting-Host: gingko.cc.swarthmore.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit