perl-MailTools/incsearch.diff

18 lines
608 B
Diff
Raw Normal View History

%INC is randomized nowadays, so sort it to get consistent results.
Also, more important, make sure $INC{$f} is really set, otherwise
we end up searching the filesystem root.
--- ./lib/Mail/Field.pm.orig 2013-07-15 12:06:12.000000000 +0000
+++ ./lib/Mail/Field.pm 2013-07-15 12:07:24.000000000 +0000
@@ -63,8 +63,9 @@ sub import
}
my($dir,$dir_sep);
- foreach my $f (keys %INC)
+ foreach my $f (sort keys %INC)
{ next if $f !~ /^Mail(\W)Field\W/i;
+ next unless $INC{$f};
$dir_sep = $1;
$dir = ($INC{$f} =~ /(.*Mail\W+Field)/i)[0] . $dir_sep;
last;