From: Wayne Davison Date: Mon, 12 Nov 2007 06:51:50 +0000 (-0800) Subject: Including my extern-squishing script, which just found an X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/c5d77e9659bb40db09376beb31ba9d23396ae601 Including my extern-squishing script, which just found an extraneous extern in exclude.c. --- diff --git a/exclude.c b/exclude.c index f1c4fdf2..467731c4 100644 --- a/exclude.c +++ b/exclude.c @@ -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; diff --git a/support/extern-squish b/support/extern-squish new file mode 100755 index 00000000..eb8b32e1 --- /dev/null +++ b/support/extern-squish @@ -0,0 +1,18 @@ +#!/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 $/; $_ = ; $/ = "\n"; + close IN; + my @externs = /^extern .*?([^[\s(*;&.]+)(?:\[.*?\])?;/mg; + foreach my $find (@externs) { + my @matches = /(?