Thread View: news.software.nn
2 messages
2 total messages
Started by Wietse Venema
Tue, 15 Jun 1993 20:38
fix for nn/nov broken 'p' command
Author: Wietse Venema
Date: Tue, 15 Jun 1993 20:38
Date: Tue, 15 Jun 1993 20:38
25 lines
1656 bytes
1656 bytes
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.
Wietse
*** more.c- Sat Sep 26 10:17:38 1992
--- more.c Tue Jun 15 17:50:24 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);
Re: fix for nn/nov broken 'p' command
Author: 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;
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads