Subject: | Bad Regular Expression |
distribution = Parse-Debian-Packages-0.01
perl -v = v5.8.4
uname -a = Linux xxxxxxx 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686 GNU/Linux
The regular expression describing a key/value pair in a Debian Packages file is not written correctly:
The module uses: m/^(.*): (.*)/
But it should use: m/^(\S.*): (.*)/
...in order to correctly parse the Description field.
--- /usr/share/perl5/Parse/Debian/Packages.pm 2005-05-03 14:38:32.000000000 -0400
+++ /usr/share/perl5/Parse/Debian/Packages.pm.new 2005-05-03 14:38:41.000000000 -0400
@@ -16,7 +16,7 @@
my %parsed;
while (<$fh>) {
last if /^$/;
- if (my ($key, $value) = m/^(.*): (.*)/) {
+ if (my ($key, $value) = m/^(\S.*): (.*)/) {
$parsed{$key} = $value;
}
else {