X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FApp%2FFatPacker.pm;h=8c77d20be6d8b9031945ddfb581285719c324f45;hb=11416666a612d4ec7f47805b6b859ed93f2f099d;hp=339cd3646b5a06aaad2e89ad7fb61cacaf69dd7e;hpb=6346585ce18ce7dbb28b4377ecbea7dbc070dc86;p=p5sagit%2FApp-FatPacker.git diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index 339cd36..8c77d20 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -14,7 +14,7 @@ use File::Copy qw(copy); use File::Path qw(mkpath rmtree); use B qw(perlstring); -our $VERSION = '0.010003'; # 0.10.3 +our $VERSION = '0.010004'; # 0.10.4 $VERSION = eval $VERSION; @@ -278,15 +278,17 @@ sub fatpack_end { if ($] < 5.008) { *{"${class}::INC"} = sub { - if (my $fat = $_[0]{$_[1]}) { - return sub { - return 0 unless length $fat; - $fat =~ s/^([^\n]*\n?)//; - $_ = $1; - return 1; - }; - } - return; + if (my $fat = $_[0]{$_[1]}) { + my $pos = 0; + my $last = length $fat; + return (sub { + return 0 if $pos == $last; + my $next = (1 + index $fat, "\n", $pos) || $last; + $_ .= substr $fat, $pos, $next - $pos; + $pos = $next; + return 1; + }); + } }; }