From 268ac1fc7f39507d0fb36fdb74a4600e66e0c2ba Mon Sep 17 00:00:00 2001 From: hniksic Date: Wed, 1 Nov 2000 16:21:53 -0800 Subject: [PATCH] [svn] Another contributed fix. --- ChangeLog | 4 ++++ util/rmold.pl | 16 +++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) 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' -- 2.39.2