From: Daniel Stenberg Date: Mon, 4 Jul 2011 20:08:14 +0000 (+0200) Subject: checksrc: detect open brace without space X-Git-Tag: curl-7_22_0~235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc97475dedb96b73e3688b216bac42b3084cadf0;p=thirdparty%2Fcurl.git checksrc: detect open brace without space We use "if(condition) {" with a space between the close paren and the open brace. --- diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 5d369496a1..c3e01305ee 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -148,6 +148,11 @@ sub scanfile { if($l =~ /^(.*)\} else/) { checkwarn($line, length($1), $file, $l, "else after closing brace on same line"); } + # check for "){" + if($l =~ /^(.*)\)\{/) { + checkwarn($line, length($1)+1, $file, $l, "missing space after close paren"); + } + # check for open brace first on line but not first column # only alert if previous line ended with a close paren and wasn't a cpp # line