]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
checkSpace: don't treat an unindented label as starting a function.
authorNick Mathewson <nickm@torproject.org>
Fri, 10 Jan 2020 14:25:04 +0000 (09:25 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 6 Feb 2020 19:33:05 +0000 (14:33 -0500)
scripts/maint/checkSpace.pl

index a5480d5ba448abe6503bfb0af8c6ba64226b9d45..bf1c69e00aa77bd378086a0270e44494e74571d8 100755 (executable)
@@ -207,7 +207,7 @@ for my $fn (@ARGV) {
             if ($in_func_head ||
                 ($fn !~ /\.h$/ && /^[a-zA-Z0-9_]/ &&
                  ! /^(?:const |static )*(?:typedef|struct|union)[^\(]*$/ &&
-                 ! /= *\{$/ && ! /;$/)) {
+                 ! /= *\{$/ && ! /;$/) && ! /^[a-zA-Z0-9_]+\s*:/) {
                 if (/.\{$/){
                     msg "fn() {:$fn:$.\n";
                     $in_func_head = 0;