Subject: | [PATCH] ExtUtils::Manifest::maniskip() incorrectly parses some lines with comments and internal whitespace filenames |
When parsing MANIFEST files with lines containing filenames with
whitespace and comments, maniskip() fails to correctly parse the line.
This was made obvious on my Win32 machine when distributing/testing a
module with filenames containing spaces.
Here is a patch with what I believe to be the correct regular expression
and code for correct filename parsing/interpretation.
Sorry the regexp is complicated, but I believe it correctly parses all
combinations of quoted/non-quoted filenames and comments. The portion of
the regexp specifically parsing the quoted filename is based on regexps
from "Mastering Regular Expressions, 2e; p. 281" and from
Text::Balanced::gen_delimited_pat($;$) [v1.95].
- Roy Ivy
Subject: | Manifest.pm-PATCHINFO |
Message body not shown because it is not plain text.
Subject: | Manifest.pm-1.54.PATCH |
--- c:\Perl\site\lib\ExtUtils\Manifest.pm Mon Nov 17 20:56:06 2008
+++ Manifest.pm.NEW Mon Apr 13 18:11:05 2009
@@ -378,11 +378,12 @@
while (<M>){
chomp;
s/\r//;
- next if /^#/;
- next if /^\s*$/;
- s/^'//;
- s/'$//;
- push @skip, _macify($_);
+ $_ =~ qr{^\s*(?:(?:'([^\\']*(?:\\.[^\\']*)*)')|([^#\s]\S*))?(?:(?:\s*)|(?:\s+(.*?)\s*))$};
+ #my $comment = $3;
+ my $filename = $2;
+ if ( defined($1) ) { $filename = $1; $filename =~ s/\\(['\\])/$1/g; }
+ next if (not defined($filename) or not $filename);
+ push @skip, _macify($filename);
}
close M;
return sub {0} unless (scalar @skip > 0);