Article View: news.software.nn
Article #4321Re: fix for nn/nov broken 'p' command
From: Wietse Venema
Date: Wed, 16 Jun 1993 19:39
Date: Wed, 16 Jun 1993 19:39
42 lines
2173 bytes
2173 bytes
I wrote:
>After picking up today the *.dist.tar.Z files from world.std.com and
>builing the patched nn under SunOS 4.1.1, I found that the 'p' command
>(show previous article) was broken. Each time 'p' was executed, the
>display would skip another paragraph of the article.
>
>The error was that setpos() did not reset the file read pointer before
>looking for the first blank line after the article headers. The patch
>below fixes the problem.
Peter Orbaek <poe@daimi.aau.dk> informed me that setpos() shouldn't
do anything at all when a digest or mail folder is being processed.
The patch below takes care of that problem, too.
Wietse
*** more.c- Sat Sep 26 10:17:38 1992
--- more.c Wed Jun 16 21:35:27 1993
***************
*** 310,315 ****
--- 310,318 ----
struct stat statb;
ah->hpos = 0;
+ /* Always search from the beginning... wietse@wzv.win.tue.nl */
+ if (startpos != 0)
+ fseek(art, 0L, 0);
while (fgets(line, sizeof line, art) != NULL)
if (*line == '\n') { /* end of headers? */
ah->fpos = ftell(art);
***************
*** 412,417 ****
--- 415,422 ----
if (lp = strrchr(send_date, ':')) *lp = NUL;
}
+ /* Don't call setpos() for digests or mailboxes - Peter Orbaek. */
+ if ((ah->flag & A_FOLDER) == 0)
setpos(ah, art);
linepos[0] = ah->hpos;
linepos[1] = firstl = ah->fpos;
Technical Details
Message-ID:
<1vnstc$1mn@wzv.win.tue.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!torn!nott!bnrgate!bnr.co.uk!zaphod.axion.bt.co.uk!uknet!mcsun!sun4nl!tuegate.tue.nl!svin09.info.win.tue.nl!wzv.win.tue.nl!wzv.win.tue.nl!not-for-mailReferences:
<1vlbvv$nib@wzv.win.tue.nl>Show Full Headers
Complete Article Headers
Message-ID: <1vnstc$1mn@wzv.win.tue.nl> Subject: Re: fix for nn/nov broken 'p' command Date: Wed, 16 Jun 1993 19:39:24 +0000 From: wietse@wzv.win.tue.nl (Wietse Venema) References: <1vlbvv$nib@wzv.win.tue.nl> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!torn!nott!bnrgate!bnr.co.uk!zaphod.axion.bt.co.uk!uknet!mcsun!sun4nl!tuegate.tue.nl!svin09.info.win.tue.nl!wzv.win.tue.nl!wzv.win.tue.nl!not-for-mail Newsgroups: news.software.nn Organization: Eindhoven University of Technology, The Netherlands Lines: 42 NNTP-Posting-Host: wzv.win.tue.nl