Commit c5d77e96 authored by Wayne Davison's avatar Wayne Davison

Including my extern-squishing script, which just found an

extraneous extern in exclude.c.
parent 2909586e
......@@ -26,7 +26,6 @@ extern int verbose;
extern int am_server;
extern int am_sender;
extern int eol_nulls;
extern int recurse;
extern int io_error;
extern int local_server;
extern int prune_empty_dirs;
......
#!/usr/bin/perl
# This script finds extraneous "extern" variables in the *.c files.
# Run it from inside the main rsync directory.
use strict;
my @files = glob('*.c');
foreach my $fn (@files) {
open(IN, '<', $fn) or die;
undef $/; $_ = <IN>; $/ = "\n";
close IN;
my @externs = /^extern .*?([^[\s(*;&.]+)(?:\[.*?\])?;/mg;
foreach my $find (@externs) {
my @matches = /(?<!\sstruct )\b(\Q$find\E)\b/g;
print $fn, ': ', $find, "\n" if @matches == 1;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment