Article View: news.software.nn
Article #1623Re: # of lines field
From: Paul Eggert
Date: Thu, 02 May 1991 19:51
Date: Thu, 02 May 1991 19:51
74 lines
2748 bytes
2748 bytes
jbeckley@qualcom.qualcomm.com writes:
>We are currently using nn 6.4.12 and the column that shows the number of
>lines for each article is correct for articles outside of our site. But
>articles originating from our site have a '?' instead. Why is this?
You're probably running C News, which doesn't put Lines: in news headers.
Articles that slosh through the net usually pick up a Lines: field
from an intervening B News site.
The following unofficial patch should fix your problem if
the site running nnmaster accesses the news articles directly, not via NNTP.
I think a more complete patch is in the works.
===================================================================
RCS file: news.c,v
retrieving revision 1.1
diff -c -r1.1 news.c
*** 1.1 1990/10/23 21:37:38
--- 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);
}
Technical Details
Message-ID:
<1991May2.195148.9935@twinsun.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.nn.mbox.zip!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggertReferences:
<1991May2.065803.926@qualcomm.com>Show Full Headers
Complete Article Headers
Message-ID: <1991May2.195148.9935@twinsun.com> Subject: Re: # of lines field Date: Thu, 02 May 1991 19:51:48 +0000 From: eggert@twinsun.com (Paul Eggert) References: <1991May2.065803.926@qualcomm.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.nn.mbox.zip!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert Newsgroups: news.software.nn Sender: usenet@twinsun.com Organization: Twin Sun, Inc Lines: 74 Nntp-Posting-Host: ata