diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-18 16:17:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-18 16:17:11 -0400 |
commit | 67dc83fa75e2009b4b6bd5d7f005adcaf45d0c77 (patch) | |
tree | 15d286a0c12c482f4addc44c7963875ee09ff391 | |
parent | 6af248f27f887a9a36a94a9f87a7b7ce66896c08 (diff) | |
download | tor-67dc83fa75e2009b4b6bd5d7f005adcaf45d0c77.tar.gz tor-67dc83fa75e2009b4b6bd5d7f005adcaf45d0c77.zip |
New check-spaces rule: Our C files may not have duplicate names.
-rwxr-xr-x | scripts/maint/checkSpace.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/maint/checkSpace.pl b/scripts/maint/checkSpace.pl index 4f4ac9b0e5..633b47e314 100755 --- a/scripts/maint/checkSpace.pl +++ b/scripts/maint/checkSpace.pl @@ -16,12 +16,21 @@ if ($ARGV[0] =~ /^-/) { $C = ($lang eq '-C'); } +our %basenames = (); + for my $fn (@ARGV) { open(F, "$fn"); my $lastnil = 0; my $lastline = ""; my $incomment = 0; my $in_func_head = 0; + my $basename = $fn; + $basename =~ s#.*/##; + if ($basenames{$basename}) { + msg "Duplicate fnames: $fn and $basenames{$basename}.\n"; + } else { + $basenames{$basename} = $fn; + } while (<F>) { ## Warn about windows-style newlines. # (We insist on lines that end with a single LF character, not |