~ubuntu-branches/ubuntu/precise/spamassassin/precise-updates

« back to all changes in this revision

Viewing changes to lib/Mail/SpamAssassin/Plugin/TextCat.pm

  • Committer: Bazaar Package Importer
  • Author(s): Noah Meyerhans
  • Date: 2010-01-26 22:53:12 UTC
  • mfrom: (1.1.13 upstream) (5.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100126225312-wkftb10idc1kz2aq
Tags: 3.3.0-1
* New upstream version.
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
use strict;
50
50
use warnings;
51
51
use bytes;
 
52
use re 'taint';
52
53
 
53
54
use vars qw(@ISA);
54
55
@ISA = qw(Mail::SpamAssassin::Plugin);
84
85
 
85
86
sub set_config {
86
87
  my ($self, $conf) = @_;
87
 
  my @cmds = ();
 
88
  my @cmds;
88
89
 
89
90
=head1 USER OPTIONS
90
91
 
353
354
  my $rang = 1;
354
355
  dbg("textcat: loading languages file...");
355
356
 
 
357
  local *LM;
356
358
  if (!open(LM, $languages_filename)) {
357
 
    warn "textcat: cannot open languages file: $!\n";
 
359
    warn "textcat: cannot open languages file $languages_filename: $!\n";
358
360
    return;
359
361
  }
360
362
 
361
 
  local $/ = undef;
362
 
  @lm = split(/\n/, <LM>);
363
 
  close(LM);
 
363
  { my($inbuf,$nread,$text); $text = '';
 
364
    while ( $nread=read(LM,$inbuf,16384) ) { $text .= $inbuf }
 
365
    defined $nread  or die "error reading $languages_filename: $!";
 
366
    @lm = split(/\n/, $text, -1);
 
367
  }
 
368
 
 
369
  close(LM)  or die "error closing $languages_filename: $!";
364
370
  # create language ngram maps once
365
371
  for (@lm) {
366
372
    # look for end delimiter