🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #1712

Re: Where has the Lines header gone

#1712
From: Paul Eggert
Date: Sat, 25 May 1991 00:56
66 lines
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);
  	}
Technical Details
Message-ID: <1991May25.005639.29538@twinsun.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.sysadmin.mbox.zip!gmdzi!unido!math.fu-berlin.de!ox.com!hela!usc!ucla-cs!twinsun!eggert
References: <andy.674886770@xwkg.Icom.Com> <andy.674969633@xwkg.Icom.Com>

Show Full Headers
Complete Article Headers
Message-ID: <1991May25.005639.29538@twinsun.com>
Subject: Re: Where has the Lines header gone
Date: Sat, 25 May 1991 00:56:39 +0000
From: eggert@twinsun.com (Paul Eggert)
References: <andy.674886770@xwkg.Icom.Com> <andy.674969633@xwkg.Icom.Com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.sysadmin.mbox.zip!gmdzi!unido!math.fu-berlin.de!ox.com!hela!usc!ucla-cs!twinsun!eggert
Newsgroups: news.sysadmin,news.software.nn
Sender: usenet@twinsun.com
Organization: Twin Sun, Inc
Lines: 65
Nntp-Posting-Host: ata