summaryrefslogtreecommitdiffstats
path: root/util/check-format.pl
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-06-07 14:47:16 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-07-20 11:17:34 +0200
commitdc18781550d5df62074d0ad16680a6dda862df6e (patch)
treee95c41cc574f696c3297781e5575ae6edd253b73 /util/check-format.pl
parent43b2e9e0088192f7e116b9b198a8c662ade193eb (diff)
check-format.pl: Add check for essentially empty line at beginning of file
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
Diffstat (limited to 'util/check-format.pl')
-rwxr-xr-xutil/check-format.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/check-format.pl b/util/check-format.pl
index 5b31cacad7..2bbf7e7c54 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;