Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 11 → Rev 10

/trunk/tools/network/news/newsstat/newsstat.pl
23,7 → 23,7
# RECENT CHANGES #
# 2011-10-03 PE - Use more compatible shebang
# - Fixed some Perl::Critic-ized code
# - Fixed wrong indent for non-ASCII names
# - Fixed wrong indent for non-ASCII names (TODO: proper dot count)
# - Formatted source code
# 2011-07-03 PE - Use Encode to decode/encode MIME encodings
# - Use warnings, utf8 (just in case)
555,15 → 555,15
#### First, analyse header fields ####
 
# Set up this poster if not defined, get counts, sizes
my $poster = $headers{From}; # get the poster's name
my $poster = encode( 'UTF-8', $headers{From} ); # get the poster's name
if ( !defined( $data{$poster} ) )
{ # seen this one before?
$data{$poster}{agent} = 'Unknown'; # comes after For: field
{ # seen this one before?
$data{$poster}{agent} = 'Unknown'; # comes after For: field
$data{$poster}{orig} = 0;
$data{$poster}{quoted} = 0;
}
$data{$poster}{count}++; # bump count for this poster
$data{$poster}{size} += $filesize; # total size of file
$data{$poster}{count}++; # bump count for this poster
$data{$poster}{size} += $filesize; # total size of file
 
# The User-Agent and/or X-Newsreader fields
# for User-Agent by poster
693,7 → 693,7
}
 
# Get threads
my $thread = $headers{"Subject"};
my $thread = encode( 'UTF-8', $headers{"Subject"} );
$thread =~ s/^re: //i; # Remove Re: or re: at start
$thread =~ s/\s+/ /g; # collapse whitespace
$threads{$thread}{count} += 1; # bump count of this subject
798,12 → 798,9
##############################
sub rpad
{
 
# get text to pad, length to pad, pad chr
my ( $text, $pad_len, $pad_chr ) = @_;
 
### DEBUG
# printf "|%s| = %d\n", $text, length($text);
 
if ( length($text) > $pad_len )
{
$text = substr( $text, 0, $pad_len );