diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-03-17 14:06:48 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-03-17 14:06:48 +0100 |
commit | 2dc1a5ce93514d4354fa01229756fc48c00513d9 (patch) | |
tree | 63554b3a7c3e0bc85e9da9713316438c58b757e9 /lib/checksrc.pl | |
parent | 0037eb58052b19bad7ce55b2317a19283c644637 (diff) | |
download | curl-2dc1a5ce93514d4354fa01229756fc48c00513d9.tar.gz |
checksrc: detect and remove space before trailing semicolons
Diffstat (limited to 'lib/checksrc.pl')
-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 190f00c93..7a7e3a94c 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -216,6 +216,11 @@ sub scanfile { checkwarn($line, length($1)+1, $file, $l, "missing space after close paren"); } + # check for space before the semicolon last in a line + if($l =~ /^(.*[^ ].*) ;$/) { + checkwarn($line, length($1), $file, $l, "space before last semicolon"); + } + # scan for use of banned functions if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|gets)\s*\(/) { checkwarn($line, length($1), $file, $l, |