managen: error on trailing blank lines in input files

Ref: #14014
Closes #14015
This commit is contained in:
Daniel Stenberg 2024-06-25 13:23:37 +02:00
parent 2d5aea9c93
commit d14a53eea7
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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);