Avoid changing file_extra_cnt during deletion.
[rsync/rsync.git] / packaging / var-checker
index b63428b..7c01725 100755 (executable)
@@ -1,11 +1,13 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 # This script checks the *.c files for extraneous "extern" variables,
 # for vars that are defined but not used, and for inconsistent array
 # sizes.  Run it from inside the main rsync directory.
 
 use strict;
+use warnings;
 
 my %add_syscall_c = map { $_ => 1 } qw( t_stub.c t_unsafe.c tls.c trimslash.c );
+my %add_compat_c = map { $_ => 1 } qw( t_stub.c tls.c trimslash.c wildtest.c );
 my %add_util_c = map { $_ => 1 } qw( t_stub.c t_unsafe.c );
 my %sizes;
 
@@ -14,6 +16,11 @@ undef $/; my $syscall_c = <IN>; $/ = "\n";
 close IN;
 $syscall_c =~ s/^extern\s.*//mg;
 
+open(IN, '<', 'lib/compat.c') or die $!;
+undef $/; my $compat_c = <IN>; $/ = "\n";
+close IN;
+$compat_c =~ s/^extern\s.*//mg;
+
 open(IN, '<', 'util.c') or die $!;
 undef $/; my $util_c = <IN>; $/ = "\n";
 close IN;
@@ -30,6 +37,7 @@ foreach my $fn (@files) {
     my @externs = /^extern\s+(.*);/mg;
 
     $_ .= $syscall_c if $add_syscall_c{$fn};
+    $_ .= $compat_c if $add_compat_c{$fn};
     $_ .= $util_c if $add_util_c{$fn};
     s/INFO_GTE/info_levels/g;
     s/DEBUG_GTE/debug_levels/g;