Thread View: news.software.nn
1 messages
1 total messages
Started by Paul Eggert
Sat, 25 May 1991 00:56
Re: Where has the Lines header gone
Author: Paul Eggert
Date: Sat, 25 May 1991 00:56
Date: Sat, 25 May 1991 00:56
66 lines
2442 bytes
2442 bytes
andy@xwkg.Icom.Com (Andrew H. Marrinson) writes:
>It is a real drag not knowing how many lines are in a
>posting before reading it. I suppose I could have nn count the lines,
>but I'll have to look into that.
The following unofficial patch to NN 6.4.16 solves the problem if your
nnmaster accesses the news files directly (i.e. not via NNTP).
Rumor has it that a more complete patch is in the works.
*** old/news.c 1990/10/23 21:37:38
--- new/news.c 1991/04/13 01:28:48
***************
*** 230,236 ****
char *digest_buffer;
char *parse_header();
struct stat statb;
! int retry;
FILE *f;
#ifdef NNTP
int lazy;
--- 230,236 ----
char *digest_buffer;
char *parse_header();
struct stat statb;
! int c, retry;
FILE *f;
#ifdef NNTP
int lazy;
***************
*** 299,310 ****
body = parse_header(f, art_hdr_field, modes, buffer1);
- news.ng_lines = news.ng_xlines ? atoi(news.ng_xlines) : -1;
if (news.ng_from == NULL) news.ng_from = news.ng_sender;
! if (modes & FILL_OFFSETS) {
art->fpos = news.ng_fpos = ftell(f);
fseek(f, (off_t)0, 2);
news.ng_lpos = ftell(f);
}
--- 299,319 ----
body = parse_header(f, art_hdr_field, modes, buffer1);
if (news.ng_from == NULL) news.ng_from = news.ng_sender;
! if (modes & FILL_OFFSETS)
art->fpos = news.ng_fpos = ftell(f);
+ if (news.ng_xlines)
+ news.ng_lines = atoi(news.ng_xlines);
+ else {
+ news.ng_lines = 0;
+ while ((c = getc(f)) != EOF)
+ if (c == '\n')
+ news.ng_lines++;
+ }
+
+ if (modes & FILL_OFFSETS) {
fseek(f, (off_t)0, 2);
news.ng_lpos = ftell(f);
}
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