[news.software.b] C News missing Lines: header

rd@tarpit.uucp (Bob Thrush) (07/20/89)

  I have noticed that all the active articles posted from C News 
systems have a "Lines:" header (except for the first few I did :-<).  
Yet the source distribution has the pertinent code in relay/sh/inews 
commented out.  In fact, it appears that code (when uncommented)
calculates one line too many.  Has everybody quietly added the
Lines: header to C News?  (Even Henry's postings have Lines.)

  For what it's worth, here's how I mangled the commented code:

TLINES="`
if test -r $HOME/.signature; then
	(cat $inbody; echo '-- '; sed 4q $HOME/.signature) | wc -l
else
	wc -l <$inbody
fi
`"
echo "Lines: `expr $TLINES - 1`"

-- 
Bob Thrush                 UUCP: {ucf-cs,rtmvax}!tarpit!rd
Automation Intelligence,   1200 W. Colonial Drive, Orlando, Florida 32804

geoff@utstat.uucp (Geoff Collyer) (07/21/89)

Vanilla C inews does not generate Lines: headers and in general produces
a fairly minimal set of headers (I initiated getting rid of
Posting-Version:, Relay-Version: and Date-Received: headers years ago).
Lines: headers are a waste of bytes (a byte count is usually what's
wanted and it can be obtained much more reliably via fstat(2) or "ls
-l"), and are often wrong due to mangling of either the Lines: headers
or the message bodies by intervening networks or mail or news software.
(As long as there are B news sites, B news will insert them anyway as
the articles propagate.)

You may see Lines: headers in articles originating on C news sites
because intervening B news sites have lovingly hand-crufted Lines:
headers on articles passing through (thus breaking one of the maxims
of good performance for network software: though shalt not look at thy
bits).

We have a slightly better fix in the works which will get the Lines:
count right, if you uncomment the code to produce it.  I favour deleting
the code altogether, but there are some very vocal fans of Lines:
nearby.
-- 
Geoff Collyer		utzoo!utstat!geoff, geoff@utstat.toronto.edu
``... skill such as yours is evidence of a misspent youth.'' - Herbert Spencer

nelson@sun.soe.clarkson.edu (Russ Nelson) (07/21/89)

In article <1989Jul21.001122.4986@utstat.uucp> geoff@utstat.uucp (Geoff Collyer) writes:

   ... Lines: headers are a waste of bytes (a byte count is usually what's
   wanted and it can be obtained much more reliably via fstat(2) or "ls
   -l"), ...

Unless you're accessing the news spool via NNTP, in which case you're out
of luck.  Perhaps XHDR can be modified to special-case a pseudo Bytes: header
and return the number of bytes in the file?
--
--russ (nelson@clutx [.bitnet | .clarkson.edu])|(70441.205@compuserve.com)

henry@utzoo.uucp (Henry Spencer) (07/21/89)

In article <1989Jul20.054808.8724@tarpit.uucp> rd@tarpit.UUCP (Bob Thrush) writes:
>  I have noticed that all the active articles posted from C News 
>systems have a "Lines:" header (except for the first few I did :-<).  
>Yet the source distribution has the pertinent code in relay/sh/inews 
>commented out.  In fact, it appears that code (when uncommented)
>calculates one line too many.  Has everybody quietly added the
>Lines: header to C News?  (Even Henry's postings have Lines.)

Some people have indeed uncommented the code (indeed, there is a fix coming
to fix the off-by-one error!).  However, a good many sites haven't.  We
certainly haven't.  What you are seeing is B News sites gratuitously
inserting this header into articles that are just passing through.
-- 
1961-1969: 8 years of Apollo.  |     Henry Spencer at U of Toronto Zoology
1969-1989: 20 years of nothing.| uunet!attcan!utzoo!henry henry@zoo.toronto.edu