[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] checkSpace: be more careful about bad function headers.



commit f39ba52029c946304cc5a67fa93ca9aab10b2941
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Jan 10 15:32:34 2020 -0500

    checkSpace: be more careful about bad function headers.
    
    Previously we would forbid macro indentations like this:
    
    FOO({
      int x;
      })
    
    But clang-format sometimes generates those.
---
 scripts/maint/checkSpace.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/maint/checkSpace.pl b/scripts/maint/checkSpace.pl
index bf1c69e00..27615f910 100755
--- a/scripts/maint/checkSpace.pl
+++ b/scripts/maint/checkSpace.pl
@@ -208,7 +208,7 @@ for my $fn (@ARGV) {
                 ($fn !~ /\.h$/ && /^[a-zA-Z0-9_]/ &&
                  ! /^(?:const |static )*(?:typedef|struct|union)[^\(]*$/ &&
                  ! /= *\{$/ && ! /;$/) && ! /^[a-zA-Z0-9_]+\s*:/) {
-                if (/.\{$/){
+                if (/[^,\s]\s*\{$/){
                     msg "fn() {:$fn:$.\n";
                     $in_func_head = 0;
                 } elsif (/^\S[^\(]* +\**[a-zA-Z0-9_]+\(/) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits