浏览代码

New check-spaces rule: Our C files may not have duplicate names.

Nick Mathewson 6 年之前
父节点
当前提交
67dc83fa75
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      scripts/maint/checkSpace.pl

+ 9 - 0
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