]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
managen: error on trailing blank lines in input files
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 Jun 2024 11:23:37 +0000 (13:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Jun 2024 14:07:07 +0000 (16:07 +0200)
Ref: #14014
Closes #14015

scripts/managen

index a12d430960c0f98b4b11017b19a2ca46e1b1295e..c56cb86a1fba7df92bdec3aa6e5d601bece0929c 100755 (executable)
@@ -270,11 +270,13 @@ sub render {
     my $top = ($line == 1);
     my $quote;
     my $level;
+    my $blankline;
     $start = 0;
 
     while(<$fh>) {
         my $d = $_;
         $line++;
+        $blankline = ($d eq "\n");
         if($d =~ /^\.(SH|BR|IP|B)/) {
             print STDERR "$f:$line:1:ERROR: nroff instruction in input: \".$1\"\n";
             return 4;
@@ -442,6 +444,10 @@ sub render {
         $header = 0;
 
     }
+    if($blankline) {
+        print STDERR "$f:$line:1:ERROR: trailing blank line\n";
+        exit 3;
+    }
     if($tablemode) {
         # end of table
         push @desc, ".RE\n.IP\n" if($manpage);