check-format.pl: Add check for essentially empty line at beginning of file
[openssl.git] / util / check-format.pl
index 5b31cacad75a4fe4d0122d70046c7a0825e17dda..2bbf7e7c54a276fe48ef683fc29053adbeb453cf 100755 (executable)
@@ -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;