Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!soliloquy!eb From: eb@soliloquy.uucp (Ed Blackmond) Newsgroups: news.software.b Subject: Re: possible vn bug? Message-ID: <33360@soliloquy.uucp> Date: 24 Dec 87 17:16:35 GMT References: <222@jc3b21.UUCP> Distribution: na Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 38 Keywords: vn core dump floating exception 2-line headers Summary: percent calculation bug In article <222@jc3b21.UUCP>, jra@jc3b21.UUCP (Jay R. Ashworth) writes: > While bopping along in vn, reading the news, (Thanks, bobm) I occasionally > get shot down by what appears to be a bug in the program. > ... > . Since the "core" doesn't "dump" until the end of the screen, could > this problem be triggered by the percent left code in the builtin > pager? The bug also appears to slightly mung the .newsrc table, as > after it happens, I get articles back to read again. > I got this too and as you suspect it is related to the percent calculation at the end of the page. I just hacked it to not do the division if it thinks there are zero lines in the article. This gives bogus percentages for these articles but I don't really care. The problem is in the function readline() in the file reader.c Here is the code I use now (sorry I forgot to check it into RCS before hacking on it so I don't have a diff): --- reader.c 196 - 205 /* ** calculation is truncated rather than rounded, ** so we shouldn't get "100%". Subtract 2 for ** 1 line lookahead and empty line at beginning ** of article. */ if (Headflag || artlin == 0) percent = ((Rlines-2)*100)/(artlin+Hlines); else percent = ((Rlines-Hlines-2)*100)/artlin; --- I added the "|| artlin == 0" test. -- Ed Blackmond Disclaimer: The above opinions are those of the Sun Microsystems author and should be considered the gospel sun!soliloquy!eb truth. ( cat Mathew/5:48 | sed s/you/I/ )