mirror of
https://github.com/curl/curl.git
synced 2026-07-28 19:23:06 +03:00
checksrc: detect open brace without space
We use "if(condition) {" with a space between the close paren and the
open brace.
This commit is contained in:
parent
c6e3081090
commit
dc97475ded
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue