Skip to content

Commit

Permalink
New check-spaces rule: Our C files may not have duplicate names.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Jun 18, 2018
1 parent 6af248f commit 67dc83f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/maint/checkSpace.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ sub msg {
$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
Expand Down

0 comments on commit 67dc83f

Please sign in to comment.