[interchange] Fix problem with lookup_exclude discovered by Andrew Baerg, which

Mike Heins <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit b20a7189552e0c6697b4ac3bcb52c2fc156fa92f
Author: Mike Heins <mike@bill.(none)>
Date:   Fri Mar 4 09:51:42 2011 -0500

    Fix problem with lookup_exclude discovered by Andrew Baerg, which
    will cause display() to return prematurely.

 lib/Vend/Form.pm |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/lib/Vend/Form.pm b/lib/Vend/Form.pm
index a08fd91..ef9bde6 100644
--- a/lib/Vend/Form.pm
+++ b/lib/Vend/Form.pm
@@ -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}) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.