Skip to content

Commit

Permalink
cmdline-opts/gen.pl: error on initital blank line
Browse files Browse the repository at this point in the history
After the "---" separator, there should be no blank line and this script
now errors out if one is detected.

Ref: curl#12696
Closes curl#12698
  • Loading branch information
bagder committed Jan 14, 2024
1 parent e186ca6 commit aaab6cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/cmdline-opts/gen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ sub single {
my @examples; # there can be more than one
my $magic; # cmdline special option
my $line;
my $dline;
my $multi;
my $scope;
my $experimental;
Expand Down Expand Up @@ -322,6 +323,11 @@ sub single {
my $tablemode = 0;
while(<F>) {
$line++;
$dline++;
if(($dline == 1) && ($_ =~ /^[\r\n]*\z/)) {
print STDERR "$f:$line:1:ERROR: unnecessary leading blank line\n";
return 3;
}
if(/^## (.*)/) {
if(!$tablemode) {
push @desc, ".RS\n";
Expand All @@ -341,6 +347,7 @@ sub single {
elsif(/^\.(IP|RS|RE)/) {
my ($cmd) = ($1);
print STDERR "$f:$line:1:ERROR: $cmd detected, use ##-style\n";
return 3;
}
push @desc, $_;
}
Expand Down

0 comments on commit aaab6cb

Please sign in to comment.