[Bps-public-commit] r14518 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Fri Jul 25 07:04:38 EDT 2008


Author: sartak
Date: Fri Jul 25 07:04:36 2008
New Revision: 14518

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/Command/Search.pm

Log:
 r65205 at onn:  sartak | 2008-07-25 07:01:26 -0400
 Avoid undef warnings in these comparisons


Modified: Prophet/trunk/lib/Prophet/CLI/Command/Search.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Search.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Search.pm	Fri Jul 25 07:04:36 2008
@@ -49,12 +49,12 @@
     my $self = shift;
     my ($expected, $cmp, $got) = @_;
 
+    $got = '' if !defined($got); # avoid undef warnings
+
     if ($cmp eq '=') {
-        return 0 if not defined $got;
         return 0 unless $got eq $expected;
     }
     elsif ($cmp eq '=~') {
-        return 0 if not defined $got;
         return 0 unless $got =~ $expected;
     }
     elsif ($cmp eq '!=' || $cmp eq '<>' || $cmp eq 'ne') {



More information about the Bps-public-commit mailing list