summaryrefslogtreecommitdiff
path: root/contrib/checkSpace.pl
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-28 09:14:07 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-28 09:14:07 +0000
commitf7c6ad065e2c433acb3fcccb1e9c7812c262579d (patch)
tree6947f81a6646d0bb3f79e55ecce03483c65450ad /contrib/checkSpace.pl
parent6f5dbefa7efe0c0c86928777b8821b3fdc91cf45 (diff)
downloadtor-f7c6ad065e2c433acb3fcccb1e9c7812c262579d.tar.gz
tor-f7c6ad065e2c433acb3fcccb1e9c7812c262579d.zip
correct multiple internal spaces
svn:r3004
Diffstat (limited to 'contrib/checkSpace.pl')
-rwxr-xr-xcontrib/checkSpace.pl24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl
index f64a22fb9b..8724250bc2 100755
--- a/contrib/checkSpace.pl
+++ b/contrib/checkSpace.pl
@@ -40,13 +40,13 @@ for $fn (@ARGV) {
}
}
if (m!/\*.*?\*/!) {
- s!/\*.*?\*/!!;
+ s!\s*/\*.*?\*/!!;
} elsif (m!/\*!) {
- s!/\*!!;
+ s!\s*/\*!!;
$incomment = 1;
next;
}
- s!"(?:[^\"]+|\\.)*"!!g;
+ s!"(?:[^\"]+|\\.)*"!"X"!g;
next if /^\#/;
## Warn about C++-style comments.
if (m!//!) {
@@ -57,16 +57,8 @@ for $fn (@ARGV) {
if (/([^\s])\{/) {
print " $1\{:$fn:$.\n";
}
- ## Warn about function calls with space before parens.
- if (/(\w+)\s\(/) {
- if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
- $1 ne "switch" and $1 ne "return" and $1 ne "int" and
- $1 ne "void" and $1 ne "__attribute__") {
- print " fn ():$fn:$.\n";
- }
- }
## Warn about multiple internal spaces.
- #if (/\S\s{2,}[^\s\\]/) {
+ #if (/[^\s,:]\s{2,}[^\s\\=]/) {
# print " X X:$fn:$.\n";
#}
## Warn about { with stuff after.
@@ -74,6 +66,14 @@ for $fn (@ARGV) {
#if (/\{[^\}\\]+$/) {
# print " {X:$fn:$.\n";
#}
+ ## Warn about function calls with space before parens.
+ if (/(\w+)\s\(/) {
+ if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
+ $1 ne "switch" and $1 ne "return" and $1 ne "int" and
+ $1 ne "void" and $1 ne "__attribute__") {
+ print " fn ():$fn:$.\n";
+ }
+ }
}
close(F);
}