Changeset 16677

Show
Ignore:
Timestamp:
08.08.2008 10:10:24 (11 years ago)
Author:
davidb
Message:

Minor tweak to EmailPlugin? to avoid directories that match \d+ being confused as e-mail files

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/EmailPlugin.pm

    r16341 r16677  
    141141sub get_default_split_exp { 
    142142    return q^\nFrom .*\d{4}\n^; 
     143     
     144} 
     145 
     146sub can_process_this_file { 
     147    my $self = shift(@_); 
     148    my ($filename) = @_; 
     149 
     150    # avoid any confusion between filenames matching \d+ (which are by default 
     151    # matched by EmailPlugin) and directories that match \d+ (which should not) 
     152 
     153    return 0 if (-d $filename);  
     154 
     155    if ($self->{'process_exp'} ne "" && $filename =~ /$self->{'process_exp'}/) { 
     156    return 1; 
     157    } 
     158    return 0; 
    143159     
    144160}