diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2011-07-04 22:08:14 +0200 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2011-07-04 22:08:14 +0200 | 
| commit | dc97475dedb96b73e3688b216bac42b3084cadf0 (patch) | |
| tree | a0fb2f695da4cdbc5e3d323ada6023fb496f4329 | |
| parent | c6e3081090a08f0e2a2ef2dc4c45327b22912796 (diff) | |
checksrc: detect open brace without space
We use "if(condition) {" with a space between the close paren and the
open brace.
| -rwxr-xr-x | lib/checksrc.pl | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 5d369496a..c3e01305e 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  | 
