diff options
| author | fukachan <fukachan> | 2008-11-30 00:50:07 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2008-11-30 00:50:07 +0000 |
| commit | 3e8c684ab082d1eed259827fc8d90ad203523814 (patch) | |
| tree | 0bf0d1189db84f1577ca766df332ffd929f0fd30 /fml | |
| parent | 8da5fd3997181dc21a931f869c60734a5de97f6b (diff) | |
| download | fml8-3e8c684ab082d1eed259827fc8d90ad203523814.tar.gz fml8-3e8c684ab082d1eed259827fc8d90ad203523814.tar.bz2 fml8-3e8c684ab082d1eed259827fc8d90ad203523814.zip | |
defined() before eq
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Process/Switch.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fml/lib/FML/Process/Switch.pm b/fml/lib/FML/Process/Switch.pm index 2a3c48d3..9772eaa9 100644 --- a/fml/lib/FML/Process/Switch.pm +++ b/fml/lib/FML/Process/Switch.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Switch.pm,v 1.113 2006/01/09 14:00:54 fukachan Exp $ +# $FML: Switch.pm,v 1.114 2006/02/04 07:54:37 fukachan Exp $ # package FML::Process::Switch; @@ -568,13 +568,15 @@ sub _program_subdir_match @n = reverse @n; @p = reverse @p; for (my $i = 0; $i <= $#n; $i++) { - if ($n[$i] eq $p[$i]) { - $point += 2; - $count++; - } - elsif ($n[$i] eq '*') { - $point += 1; - $count++; + if (defined $n[$i]) { + if (defined $p[$i] && ($n[$i] eq $p[$i])) { + $point += 2; + $count++; + } + elsif ($n[$i] eq '*') { + $point += 1; + $count++; + } } } |
