Improve the checking of pod sections
authorRichard Levitte <levitte@openssl.org>
Sun, 22 May 2016 22:36:37 +0000 (00:36 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 22 May 2016 22:45:44 +0000 (00:45 +0200)
(i.e. remove some bugs)

Reviewed-by: Rich Salz <rsalz@openssl.org>
util/process_docs.pl

index 150e48bf088f42d4b488e6acbf989cc7d6a10822..c07cb755ccdf576937ab1a27b28afedd0adb2945 100644 (file)
@@ -87,8 +87,10 @@ foreach my $subdir (keys %{$options{subdir}}) {
                 print STDERR "Found section number $1\n" if $options{debug};
                 $podinfo{section} = $1;
             }
-            last if m|^=head1| && defined $podinfo{lastsect} eq "NAME";
-            if (m|^head1=\s*(.*)|) {
+            last if (m|^=head1|
+                     && defined $podinfo{lastsect}
+                     && $podinfo{lastsect} eq "NAME");
+            if (m|^=head1\s*(.*)|) {
                 $podinfo{lastsect} = $1;
                 $podinfo{lastsect} =~ s/\s+$//;
                 $podinfo{lastsecttext} = "";