https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5875
Summary: MEMORY WASTE: eval in _get_cf_pre_files_in_dir needs to
be quoted instead of {}ed as it brings in File::Find
anyways
Product: Spamassassin
Version: 3.2.4
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: P5
Component: spamassassin
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
sub _get_cf_pre_files_in_dir {
my ($self, $dir, $type) = @_;
Carp::cluck( "X: " . $self->{config_tree_recurse} . " : X");
if ($self->{config_tree_recurse}) {
my @cfs = ();
# use "eval" to avoid loading File::Find unless this is specified
eval '
use File::Find qw();
File::Find::find(
sub {
return unless (/\.${type}$/i && -f $_);
push @cfs, $File::Find::name;
}, $dir);
';
return sort { $a cmp $b } @cfs;
die "oops! $@"; # should never get here
}
else {
opendir(SA_CF_DIR, $dir) or warn "config: cannot opendir $dir: $!\n";
my @cfs = grep { /\.${type}$/i && -f "$dir/$_" } readdir(SA_CF_DIR);
closedir SA_CF_DIR;
return map { "$dir/$_" } sort { $a cmp $b } @cfs;
}
}
--
Configure bugmail:
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.