]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
New check-spaces rule: Our C files may not have duplicate names.
authorNick Mathewson <nickm@torproject.org>
Mon, 18 Jun 2018 20:17:11 +0000 (16:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 18 Jun 2018 20:17:11 +0000 (16:17 -0400)
scripts/maint/checkSpace.pl

index 4f4ac9b0e5dbf4760594366c67c7381ea7469bb3..633b47e314864d37c8f7855dda8996d9c8786f4c 100755 (executable)
@@ -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