diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2010-02-20 13:44:15 -0800 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2010-02-22 16:52:11 -0800 |
commit | 21f91dcb505fbfedd13be5942055f8591605e5c7 (patch) | |
tree | 1aaed6ac5f8d562991ed472b3b662a471af13e3a /contrib | |
parent | 245be159afa206676b05b9b5d5a11aa1f6b25bd7 (diff) | |
download | tor-21f91dcb505fbfedd13be5942055f8591605e5c7.tar tor-21f91dcb505fbfedd13be5942055f8591605e5c7.tar.gz |
Patch from karsten to detect unnecessary \n's.
Also fix a spacing issue.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/checkSpace.pl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl index db061a082..b694abff6 100755 --- a/contrib/checkSpace.pl +++ b/contrib/checkSpace.pl @@ -28,11 +28,15 @@ for $fn (@ARGV) { if ($C && /\s(?:if|while|for|switch)\(/) { print " KW(:$fn:$.\n"; } - ## Warn about #else #if instead of #elif. - if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) { + ## Warn about #else #if instead of #elif. + if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) { print " #else#if:$fn:$.\n"; - } - $lastline = $_; + } + $lastline = $_; + ## Warn about unnecessary empty lines. + if ($lastnil && /^\s*}\n/) { + print " UnnecNL:$fn:$.\n"; + } ## Warn about multiple empty lines. if ($lastnil && /^$/) { print " DoubleNL:$fn:$.\n"; |