From: Dr. David von Oheimb Date: Sun, 7 Jun 2020 12:47:16 +0000 (+0200) Subject: check-format.pl: Add check for essentially empty line at beginning of file X-Git-Tag: openssl-3.0.0-alpha6~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc18781550d5df62074d0ad16680a6dda862df6e;p=thirdparty%2Fopenssl.git check-format.pl: Add check for essentially empty line at beginning of file Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12270) --- diff --git a/util/check-format.pl b/util/check-format.pl index 5b31cacad75..2bbf7e7c54a 100755 --- a/util/check-format.pl +++ b/util/check-format.pl @@ -1074,7 +1074,9 @@ while (<>) { # loop over all lines of all input files $hanging_offset = 0; # compensate for this in case macro ends, e.g., as 'while (0)' } - unless (m/^\s*$/) { # not essentially empty line: just whitespace (and maybe a '\') + if (m/^\s*$/) { # essentially empty line: just whitespace (and maybe a '\') + report("empty line at beginnig of file") if $line == 1; + } else { if ($line_before > 0) { my $linediff = $line - $line_before - 1; report("$linediff empty lines before") if $linediff > 1;