- fix boolification in && and ||
authorMichael Schröder <mls@suse.de>
Mon, 29 Sep 2008 13:47:07 +0000 (13:47 +0000)
committerMichael Schröder <mls@suse.de>
Mon, 29 Sep 2008 13:47:07 +0000 (13:47 +0000)
Build/Rpm.pm

index a476093..3877a01 100644 (file)
@@ -43,11 +43,19 @@ sub expr {
       return ($v, $expr) if $lev > 1;
       ($v2, $expr) = expr(substr($expr, 2), 1);
       return undef unless defined $v2;
+      $v = 0 if $v && $v eq '\"\"';
+      $v =~ s/^0+/0/;
+      $v2 = 0 if $v2 && $v2 eq '\"\"';
+      $v2 =~ s/^0+/0/;
       $v &&= $v2;
     } elsif ($expr =~ /^\|\|/) {
       return ($v, $expr) if $lev > 1;
       ($v2, $expr) = expr(substr($expr, 2), 1);
       return undef unless defined $v2;
+      $v = 0 if $v && $v eq '\"\"';
+      $v =~ s/^0+/0/;
+      $v2 = 0 if $v2 && $v2 eq '\"\"';
+      $v2 =~ s/^0+/0/;
       $v ||= $v2;
     } elsif ($expr =~ /^>=/) {
       return ($v, $expr) if $lev > 2;