summaryrefslogtreecommitdiff
path: root/lib/checksrc.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-03-17 13:05:01 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-03-17 13:05:01 +0100
commita6b8fe2a5f6f18bd1a6fd0767a961fa1e87aba3e (patch)
tree2ec419b11c482a34aaa1229b2ef0b12968ceecd0 /lib/checksrc.pl
parent3dbe12a1e9eb7fc4b4a4172c244c460d3e021143 (diff)
downloadcurl-a6b8fe2a5f6f18bd1a6fd0767a961fa1e87aba3e.tar.gz
checksrc: use space before paren in "return (expr);"
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-xlib/checksrc.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index f561492a7..c4174709b 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2011 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 2011 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -144,6 +144,17 @@ sub scanfile {
}
}
+ # check for "return(" without space
+ if($l =~ /^(.*)return\(/) {
+ if($1 =~ / *\#/) {
+ # this is a #if, treat it differently
+ }
+ else {
+ checkwarn($line, length($1)+6, $file, $l,
+ "return without space before paren");
+ }
+ }
+
# check for "} else"
if($l =~ /^(.*)\} *else/) {
checkwarn($line, length($1), $file, $l, "else after closing brace on same line");