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

This commit is contained in:
Nick Mathewson 2018-06-18 16:17:11 -04:00
parent 6af248f27f
commit 67dc83fa75

View File

@ -16,12 +16,21 @@ if ($ARGV[0] =~ /^-/) {
$C = ($lang eq '-C'); $C = ($lang eq '-C');
} }
our %basenames = ();
for my $fn (@ARGV) { for my $fn (@ARGV) {
open(F, "$fn"); open(F, "$fn");
my $lastnil = 0; my $lastnil = 0;
my $lastline = ""; my $lastline = "";
my $incomment = 0; my $incomment = 0;
my $in_func_head = 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>) { while (<F>) {
## Warn about windows-style newlines. ## Warn about windows-style newlines.
# (We insist on lines that end with a single LF character, not # (We insist on lines that end with a single LF character, not