Browse Source

Allow multiple consecutive empty lines

Wichert Akkerman 24 years ago
parent
commit
e24b41d37e
2 changed files with 9 additions and 2 deletions
  1. 4 0
      ChangeLog
  2. 5 2
      scripts/controllib.pl

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Sun Apr 14 00:49:09 CEST 2002 Wichert Akkerman <wichert@deephackmode.org>
+
+  * scripts/controlllib.pl: accept multilpe consectucive empty lines
+
 Sat Apr 13 22:59:25 CEST 2002 Wichert Akkerman <wichert@deephackmode.org>
 
   * man/en/deb-control.5.sgml: DocBook version of deb-control manpage

+ 5 - 2
scripts/controllib.pl

@@ -177,10 +177,12 @@ sub parsecdata {
     # many=0: ordinary control data like output from dpkg-parsechangelog
     # many=1: many paragraphs like in source control file
     # many=-1: single paragraph of control data optionally signed
-    local ($index,$cf);
-    $index=''; $cf='';
+    local ($index,$cf,$paraborder);
+    $index=''; $cf=''; $paraborder=1;
     while (<CDATA>) {
         s/\s*\n$//;
+	if (m/^$/) and $paraborder) next;
+	$paraborder=0;
         if (m/^(\S+)\s*:\s*(.*)$/) {
             $cf=$1; $v=$2;
             $cf= &capit($cf);
@@ -194,6 +196,7 @@ sub parsecdata {
             while (<CDATA>) { last if m/^$/; }
             $many= -2;
         } elsif (m/^$/) {
+	    $paraborder = 1;
             if ($many>0) {
                 $index++; $cf='';
             } elsif ($many == -2) {