summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-11-30 21:07:40 +0100
committerTomas Mraz <tomas@openssl.org>2023-02-08 16:22:06 +0100
commit33c7ad364fd757e312fc08b686e5a1f32a14f925 (patch)
treeb19b5cb9cb4348d6f18463b2878adc5b0552f05b /util
parent25624c9087d5422c3bb93cd987a066cb7c883a16 (diff)
downloadopenssl-new-33c7ad364fd757e312fc08b686e5a1f32a14f925.tar.gz
check-format.pl: fix detection of function body start
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19796)
Diffstat (limited to 'util')
-rwxr-xr-xutil/check-format.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/check-format.pl b/util/check-format.pl
index 022b71e31d..8303c7823f 100755
--- a/util/check-format.pl
+++ b/util/check-format.pl
@@ -165,8 +165,8 @@ my $count_before; # number of leading whitespace characters (except lin
my $has_label; # current line contains label
my $local_offset; # current extra indent due to label, switch case/default, or leading closing brace(s)
my $line_body_start; # number of line where last function body started, or 0
-my $line_function_start; # number of line where last function definition started, used if $line_body_start != 0
-my $last_function_header; # header containing name of last function defined, used if $line_function_start != 0
+my $line_function_start; # number of line where last function definition started, used for $line_body_start
+my $last_function_header; # header containing name of last function defined, used if $line_body_start != 0
my $line_opening_brace; # number of previous line with opening brace after do/while/for, optionally for if/else
my $keyword_opening_brace; # name of previous keyword, used if $line_opening_brace != 0
@@ -1129,7 +1129,7 @@ while (<>) { # loop over all lines of all input files
if (!$assignment_start && !$local_in_expr) {
# at end of function definition header (or stmt or var definition)
report("'{' not at line start") if length($head) != $preproc_offset && $head =~ m/\)\s*/; # at end of function definition header
- $line_body_start = $contents =~ m/LONG BODY/ ? 0 : $line;
+ $line_body_start = $contents =~ m/LONG BODY/ ? 0 : $line if $line_function_start != 0;
}
} else {
$line_opening_brace = $line if $keyword_opening_brace =~ m/do|while|for/;