Add the X509v3_cache_extensions() function
[openssl.git] / util / check-format.pl
old mode 100644 (file)
new mode 100755 (executable)
index af77d20..b7c28f1
@@ -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
@@ -1000,7 +1001,7 @@ while (<>) { # loop over all lines of all input files
     # check for opening brace after if/while/for/switch/do not on same line
     # note that "no '{' on same line after '} else'" is handled further below
     if (/^[\s@]*{/ && # leading '{'
-        $line_before > 0 &&
+        $line_before > 0 && !($contents_before_ =~ m/^\s*#/) && # not preprocessor directive '#if
         (my ($head, $mid, $tail) = ($contents_before_ =~ m/(^|^.*\W)(if|while|for|switch|do)(\W.*$|$)/))) {
         my $brace_after  = $tail =~ /^[\s@]*{/; # any whitespace or comments then '{'
         report("'{' not on same line as preceding '$mid'") if !$brace_after;