summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2008-11-30 00:50:07 +0000
committerfukachan <fukachan>2008-11-30 00:50:07 +0000
commit3e8c684ab082d1eed259827fc8d90ad203523814 (patch)
tree0bf0d1189db84f1577ca766df332ffd929f0fd30
parent8da5fd3997181dc21a931f869c60734a5de97f6b (diff)
downloadfml8-3e8c684ab082d1eed259827fc8d90ad203523814.tar.gz
fml8-3e8c684ab082d1eed259827fc8d90ad203523814.tar.bz2
fml8-3e8c684ab082d1eed259827fc8d90ad203523814.zip
defined() before eq
-rw-r--r--fml/lib/FML/Process/Switch.pm18
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++;
+ }
}
}