From 0e3de6438268c17083907e7410471d9ee497963f Mon Sep 17 00:00:00 2001 From: mitty Date: Fri, 25 Jan 2013 09:26:26 +0000 Subject: [PATCH] * fix: previous procedure skips files such as '...' git-svn-id: https://lab.mitty.jp/svn/lab/trunk@193 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- misc/findcombinable.pl | 3 +-- misc/findnonsjis.pl | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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; -- 1.7.9.5