#
######################################################################
#
-# Run as: ./min-includes.pl `find . -name "*.c" -print`
+# Run as: ./min-includes.pl $(find . -name "*.c" -print)
# prints out duplicate includes from files.
#
-# ./min-includes.pl +n `find . -name "*.c" -print`
+# ./min-includes.pl +n $(find . -name "*.c" -print)
# removes the duplicate includes from each file.
# Remember to check that it still builds!
#
sub process {
my $file = shift;
+ $file =~ s,//,/,g;
+
return if ($processed{$file});
$processed{$file}++;
$path =~ s:/.*?/\.\.::;
next if (! -e $path);
+ next if $reverse{$path};
+
process($path);
$forward{$inc} = $path;
$reverse{$path} = $inc;