Explorar el Código

Dpkg::Control::Hash: Strip leading spaces in the first line of a field's value

The fields in a compliant control-style file are allowed to have values
starting with any number of spaces. But that only applies to the first
line on multi-line field values, so do not do the same on subsequent
lines as those are handled differently.

Regression introduced in commit 7d8d193332478de82e20ed5b49053378801d160f.

Closes: #557547
Guillem Jover hace 16 años
padre
commit
b8c2b200c3
Se han modificado 3 ficheros con 4 adiciones y 2 borrados
  1. 2 0
      debian/changelog
  2. 1 1
      scripts/Dpkg/Control/Hash.pm
  3. 1 1
      scripts/t/700_Dpkg_Control.t

+ 2 - 0
debian/changelog

@@ -13,6 +13,8 @@ dpkg (1.15.5.3) UNRELEASED; urgency=low
   * Verify that the alternative used in update-alternatives --set has been
     registered instead of failing with an undefined value in the slave
     method. Closes: #554136
+  * Strip leading spaces in the first line of a field's value in
+    Dpkg::Control::Hash. Closes: #557547
 
  -- Raphael Hertzog <hertzog@debian.org>  Sat, 21 Nov 2009 14:57:50 +0100
 

+ 1 - 1
scripts/Dpkg/Control/Hash.pm

@@ -168,7 +168,7 @@ sub parse_fh {
 	next if (m/^$/ and $paraborder);
 	next if (m/^#/);
 	$paraborder = 0;
-	if (m/^(\S+?)\s*:\s?(.*)$/) {
+	if (m/^(\S+?)\s*:\s*(.*)$/) {
 	    if (exists $self->{$1}) {
 		unless ($$self->{'allow_duplicate'}) {
 		    syntaxerr($desc, sprintf(_g("duplicate field %s found"), $1));

+ 1 - 1
scripts/t/700_Dpkg_Control.t

@@ -48,7 +48,7 @@ Depends: hello
 
 Package: mypackage3
 Depends: hello
-Description:   short one
+Description: short one
  long one
  very long one
 ';