From: mitty Date: Fri, 25 Jan 2013 09:26:26 +0000 (+0000) Subject: * fix: previous procedure skips files such as '...' X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=0e3de6438268c17083907e7410471d9ee497963f;p=lab.git * fix: previous procedure skips files such as '...' git-svn-id: https://lab.mitty.jp/svn/lab/trunk@193 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/misc/findcombinable.pl b/misc/findcombinable.pl index 7b9d629..8d515d9 100755 --- a/misc/findcombinable.pl +++ b/misc/findcombinable.pl @@ -32,12 +32,11 @@ sub checkdir { print STDERR "checking '$target'\n"; opendir(my $dir, $target) || return $target; - my @entries = sort readdir($dir); + my @entries = sort grep { !m/^(\.|\.\.)$/g } readdir($dir); closedir($dir); my @dirs; while (my $entry = shift @entries) { - next if ($entry =~ /^\.+$/); $entry = $utf8->decode($entry); if (match($entry)) { print "'$target/$entry' can be composed\n"; diff --git a/misc/findnonsjis.pl b/misc/findnonsjis.pl index 2469ca5..87c8ea5 100755 --- a/misc/findnonsjis.pl +++ b/misc/findnonsjis.pl @@ -29,12 +29,11 @@ sub checkdir { print STDERR "checking '$target'\n"; opendir(my $dir, $target) || return $target; - my @entries = sort readdir($dir); + my @entries = sort grep { !m/^(\.|\.\.)$/g } readdir($dir); closedir($dir); my @dirs; while (my $entry = shift @entries) { - next if ($entry =~ /^\.+$/); if (match($entry)) { print "'$target/$entry' contains non Shift_JIS character\n"; next;