process_docs.pl: When starting to read a new head1 section, remove previous text
authorRichard Levitte <levitte@openssl.org>
Sat, 21 May 2016 18:50:48 +0000 (20:50 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 22 May 2016 22:45:44 +0000 (00:45 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
util/process_docs.pl

index eaa4964..150e48b 100644 (file)
@@ -91,9 +91,10 @@ foreach my $subdir (keys %{$options{subdir}}) {
             if (m|^head1=\s*(.*)|) {
                 $podinfo{lastsect} = $1;
                 $podinfo{lastsect} =~ s/\s+$//;
+                $podinfo{lastsecttext} = "";
             }
             next if (m|^=| || m|^\s*$|);
-            $podinfo{lastsecttext} .= " ";
+            $podinfo{lastsecttext} .= " " if $podinfo{lastsecttext};
             $podinfo{lastsecttext} .= $_;
         }
         close $pod_fh;