From: hniksic Date: Thu, 2 Nov 2000 00:21:53 +0000 (-0800) Subject: [svn] Another contributed fix. X-Git-Tag: v1.13~2410 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=268ac1fc7f39507d0fb36fdb74a4600e66e0c2ba [svn] Another contributed fix. --- diff --git a/ChangeLog b/ChangeLog index 651881bf..b7643e11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-11-02 Matthew Seaman + + * util/rmold.pl: Various fixes. + 2000-11-01 Hrvoje Niksic * configure.in: Check for size of long and long long. diff --git a/util/rmold.pl b/util/rmold.pl index f68744b1..a14f2dc2 100755 --- a/util/rmold.pl +++ b/util/rmold.pl @@ -31,10 +31,8 @@ if (@ARGV && ($ARGV[0] eq '-v')) { $verbose = 1; } -defined($dirs[0] = shift) || ($dirs[0] = '.'); -while (defined($_ = shift)) { - @dirs = (@dirs, $_); -} +(@dirs = @ARGV) || push (@dirs,'.'); + foreach $_ (@dirs) { &procdir($_); @@ -44,7 +42,7 @@ foreach $_ (@dirs) { sub procdir { - local($dir = $_[0]); + local $dir = shift; local(@lcfiles, @lcdirs, %files, @fl); print STDERR "Processing directory '$dir':\n" if $verbose; @@ -55,17 +53,17 @@ sub procdir # Read local files and directories. foreach $_ (readdir(DH)) { /^(\.listing|\.\.?)$/ && next; - if (-d "$dir/$_" || -l "$dir/$_") { - @lcdirs = (@lcdirs, $_); + lstat ("$dir/$_"); + if (-d _) { + push (@lcdirs, $_); } else { - @lcfiles = (@lcfiles, $_); + push (@lcfiles, $_); } } closedir(DH); # Parse .listing if (open(FD, "<$dir/.listing")) { - @files = (); while () { # Weed out the line beginning with 'total'