summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-06-22 13:15:03 +0200
committerGuillem Jover <guillem@debian.org>2015-07-29 02:29:08 +0200
commit95d9b43f8ad87bcfc180bd3cd9631c1f7ea83569 (patch)
treeff2d4e84da5de5cc5998885a217b7334a0c62d43 /scripts
parent43556e0a9f216d59b4bc1a0f4e6e10e9afea3f7d (diff)
downloaddpkg-95d9b43f8ad87bcfc180bd3cd9631c1f7ea83569.tar.gz
Dpkg::Control::HashCore: Remove trailing space before handling dot-separators
Regression introduced in commit aea291e3db1ac0414dcf005a0a607e78bdd77a5e. Any spaces after the blank line dot-separator should be stripped before handling the dot-separator, otherwise we get duplicated dots in field contents. Closes: #789580 Stable-Candidate: 1.16.x 1.17.x
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Dpkg/Control/HashCore.pm2
-rw-r--r--scripts/t/Dpkg_Control.t2
-rw-r--r--scripts/t/Dpkg_Control/control-11
3 files changed, 4 insertions, 1 deletions
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 3a7b55116..21b474eac 100644
--- a/scripts/Dpkg/Control/HashCore.pm
+++ b/scripts/Dpkg/Control/HashCore.pm
@@ -220,10 +220,10 @@ sub parse {
unless (defined($cf)) {
$self->parse_error($desc, g_('continued value line not in field'));
}
+ $line =~ s/\s*$//;
if ($line =~ /^\.+$/) {
$line = substr $line, 1;
}
- $line =~ s/\s*$//;
$self->{$cf} .= "\n$line";
} elsif (m/^-----BEGIN PGP SIGNED MESSAGE-----[\r\t ]*$/) {
$expect_pgp_sig = 1;
diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t
index e73f8ec2c..e8089fbb8 100644
--- a/scripts/t/Dpkg_Control.t
+++ b/scripts/t/Dpkg_Control.t
@@ -53,6 +53,7 @@ Long-Field: line1
line 2 line 2 line 2
.
line 3 line 3 line 3
+ .
..
line 4
Empty-Field:
@@ -83,6 +84,7 @@ is($src->{'long-field'},
line 2 line 2 line 2
line 3 line 3 line 3
+
.
line 4', 'Get multi-line field');
is($src->{'Empty-field'}, '', 'Get empty field');
diff --git a/scripts/t/Dpkg_Control/control-1 b/scripts/t/Dpkg_Control/control-1
index afe618ec1..0c7053332 100644
--- a/scripts/t/Dpkg_Control/control-1
+++ b/scripts/t/Dpkg_Control/control-1
@@ -7,6 +7,7 @@ long-field: line1
line 2 line 2 line 2
.
line 3 line 3 line 3
+ .
..
line 4
empty-field: