[or-cvs] [tor/master 08/17] Patch from karsten to detect unnecessary \n's.
nickm at torproject.org
nickm at torproject.org
Thu Feb 25 21:25:11 UTC 2010
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Sat, 20 Feb 2010 13:44:15 -0800
Subject: Patch from karsten to detect unnecessary \n's.
Commit: 21f91dcb505fbfedd13be5942055f8591605e5c7
Also fix a spacing issue.
---
contrib/checkSpace.pl | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl
index db061a0..b694abf 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";
--
1.6.5
More information about the tor-commits
mailing list