summaryrefslogtreecommitdiff
path: root/util/check-format.pl
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-03-09 14:42:40 +0100
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-03-18 13:43:36 +0100
commit38e497818e8775f16cfff12ca3226acbd2f30471 (patch)
treeb7c82a53e8891ec932f2e79f4a34fc615a5c0d01 /util/check-format.pl
parentcde63b731575e6be41b3f94bcd9fa941cdc45488 (diff)
downloadopenssl-new-38e497818e8775f16cfff12ca3226acbd2f30471.tar.gz
fix false positive of check-format.pl reporting '{1 stmt}' after multi-line 'if(expr)'
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11285)
Diffstat (limited to 'util/check-format.pl')
-rw-r--r--util/check-format.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/check-format.pl b/util/check-format.pl
index af77d20920..a0b493e600 100644
--- a/util/check-format.pl
+++ b/util/check-format.pl
@@ -868,7 +868,8 @@ while (<>) { # loop over all lines of all input files
if ($paren_expr_start || $return_enum_start || $assignment_start)
{
my ($head, $mid, $tail) = ($1, $3, $4);
- $keyword_opening_brace = $mid if $mid ne "=" && $tail =~ m/\{/;
+ $keyword_opening_brace = $mid if $mid ne "=";
+ # to cope with multi-line expressions, do this also if !($tail =~ m/\{/)
push @in_if_hanging_offsets, $hanging_offset if $mid eq "if";
# already handle $head, i.e., anything before expression