Skip to content

Commit

Permalink
look for the header before the license body
Browse files Browse the repository at this point in the history
  • Loading branch information
charsbar authored and rjbs committed Nov 17, 2013
1 parent f6de8eb commit 98a46a4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/Software/LicenseUtils.pm
Expand Up @@ -77,19 +77,26 @@ for my $lib (map { "$_/Software/License" } @INC) {
sub guess_license_from_pod {
my ($class, $pm_text) = @_;
die "can't call guess_license_* in scalar context" unless wantarray;
return unless $pm_text =~ /
(
=head \d \s+
(?:licen[cs]e|licensing|copyright|legal)\b
)
/ixmsg;

my $header = $1;

if (
$pm_text =~ m/
\G
(
=head \d \s+
(?:licen[cs]e|licensing|copyright|legal)\b
.*?
)
(=head\\d.*|=cut.*|)
\z
/ixms
) {
my $license_text = $1;
my $license_text = "$header$1";

for (my $i = 0; $i < @phrases; $i += 2) {
my ($pattern, $license) = @phrases[ $i .. $i+1 ];
Expand Down

0 comments on commit 98a46a4

Please sign in to comment.