From d14a53eea7b87727e400d7f99ea9137a88a6e995 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jun 2024 13:23:37 +0200 Subject: [PATCH] managen: error on trailing blank lines in input files Ref: #14014 Closes #14015 --- scripts/managen | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/managen b/scripts/managen index a12d430960..c56cb86a1f 100755 --- a/scripts/managen +++ b/scripts/managen @@ -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); -- 2.47.3