Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix problem with lookup_exclude discovered by Andrew Baerg, which

will cause display() to return prematurely.
  • Loading branch information...
commit b20a7189552e0c6697b4ac3bcb52c2fc156fa92f 1 parent ce8ce40
Mike Heins authored
Showing with 5 additions and 11 deletions.
  1. +5 −11 lib/Vend/Form.pm
16 lib/Vend/Form.pm
View
@@ -1272,24 +1272,18 @@ if($opt->{debug}) {
$ary = [['', errmsg('--no current values--')]];
}
if($opt->{lookup_exclude}) {
- my $sub;
+ my $re;
eval {
- $sub = sub { $_[0] !~ m{$opt->{lookup_exclude}} };
+ $re = qr/$opt->{lookup_exclude}/;
};
if ($@) {
logError(
"Bad lookup pattern m{%s}: %s", $opt->{lookup_exclude}, $@,
);
- undef $sub;
- }
- if($sub) {
- @$data = grep $_,
- map {
- $sub->(join '=', @$_)
- or return undef;
- return $_;
- } @$data;
+ undef $re;
}
+
+ $re and @$data = grep "$_->[0]=$_->[1]" !~ /$re/, @$data;
}
unless($opt->{lookup_merge}) {
Please sign in to comment.
Something went wrong with that request. Please try again.