]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
check-format.pl: Add check for essentially empty line at beginning of file
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Sun, 7 Jun 2020 12:47:16 +0000 (14:47 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Mon, 20 Jul 2020 09:17:34 +0000 (11:17 +0200)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12270)

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;