summaryrefslogtreecommitdiff
path: root/util/check-format.pl
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-06-06 21:14:29 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-07-20 11:17:34 +0200
commit43b2e9e0088192f7e116b9b198a8c662ade193eb (patch)
tree1700af6292acecd115d2dee942fdd061710f2e11 /util/check-format.pl
parenta77571c34f61ceb455a4aa357d4d95e412f9e9f8 (diff)
downloadopenssl-new-43b2e9e0088192f7e116b9b198a8c662ade193eb.tar.gz
check-format.pl: Add check for multiples essentially empty lines in a row
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.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/check-format.pl b/util/check-format.pl
index d731926039..5b31cacad7 100755
--- a/util/check-format.pl
+++ b/util/check-format.pl
@@ -1074,7 +1074,11 @@ 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*$/) { # essentially empty line: just whitespace (and maybe a '\')
+ unless (m/^\s*$/) { # not essentially empty line: just whitespace (and maybe a '\')
+ if ($line_before > 0) {
+ my $linediff = $line - $line_before - 1;
+ report("$linediff empty lines before") if $linediff > 1;
+ }
$line_before2 = $line_before;
$contents_before2 = $contents_before;
$contents_before_2 = $contents_before_;