X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=config%2Fri_once.pl;h=9593a156f8a6f85624e5e0319f4528277a867ead;hb=e7aef88d9b6be9c127311330c9fb16e2c0d86188;hp=3c77f2ae89cb4241fef705a039fc9e20d78d2acb;hpb=ccad13abe5a4d9d786d05f92cfab9b9d63685cd1;p=squirrelmail.git diff --git a/config/ri_once.pl b/config/ri_once.pl index 3c77f2ae..9593a156 100755 --- a/config/ri_once.pl +++ b/config/ri_once.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # ri_once.pl # Wouter Teepe (wouter@teepe.com) # @@ -215,15 +215,28 @@ sub dofile { # process a directory recursively sub dodir { + my $dirname; + my $file; + my $full; + my @files; + my $i; $dirname = $_[0]; $dirname =~ s/\/$//; opendir(DIR, $dirname) or die "can't opendir $dirname: $!"; + $i = 0; while (defined($file = readdir(DIR))) { + @files[$i++] = $file; + } + $i = 0; + while (defined($file = @files[$i++])) { next if $file =~ /^\.\.?$/; $full = $dirname.'/'.$file; +# print "found: $full\n"; if (-d $full) { +# print "doing dir: $full\n"; &dodir($full); } else { if ($file =~ /.*\.php$/) { +# print "doing file: $full\n"; &dofile($full); }} }