Skip to content

Commit

Permalink
Bugfix: include files without trailing \n cause broken MANIFEST.SKIP …
Browse files Browse the repository at this point in the history
…files

Internally, all lines are in an array, with each entry \n terminated.

However, this leads to a problem when the last line in in an included
file lacks a \n, as this gets stored as:

  [ "secondlastline\n", "lastline", "#!end included" ]

Which stringifies as:

  secondlastline
  lastline#!end included

And that lastline doesn't match the files its supposed to.

Closes GH Perl-Toolchain-Gang#14
  • Loading branch information
kentfredric committed Apr 6, 2015
1 parent ae2af66 commit 52c62ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ExtUtils/Manifest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ sub _include_mskip_file {
push @lines, "\n#!start included $mskip\n";
push @lines, $_ while <M>;
close M;
# Ensure the last line that came from an included skip file has a trailing \n
# or the one after it gets join()'d onto the end of it!
$lines[-1] =~ s/\n?$/\n/;
push @lines, "#!end included $mskip\n\n";
return @lines;
}
Expand Down

0 comments on commit 52c62ee

Please sign in to comment.