[interchange-cvs] interchange - heins modified lib/Vend/Util.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sat Nov 9 01:04:00 2002


User:      heins
Date:      2002-11-09 06:03:36 GMT
Modified:  lib/Vend Util.pm
Log:
* Fix bug where bad [nitems compare=...] could cause server error. Now
  just silently causes bad compare -- perhaps I should add logging?

Revision  Changes    Path
2.40      +6 -5      interchange/lib/Vend/Util.pm


rev 2.40, prev_rev 2.39
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -r2.39 -r2.40
--- Util.pm	4 Nov 2002 21:36:37 -0000	2.39
+++ Util.pm	9 Nov 2002 06:03:36 -0000	2.40
@@ -1,6 +1,6 @@
 # Vend::Util - Interchange utility functions
 #
-# $Id: Util.pm,v 2.39 2002/11/04 21:36:37 racke Exp $
+# $Id: Util.pm,v 2.40 2002/11/09 06:03:36 mheins Exp $
 # 
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -83,7 +83,7 @@
 use Safe;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.39 $, 10);
+$VERSION = substr(q$Revision: 2.40 $, 10);
 
 BEGIN {
 	eval {
@@ -1491,9 +1491,10 @@
 	if($opt->{qualifier}) {
 		$attr = $opt->{qualifier};
 		my $qr;
-		$qr = qr{$opt->{compare}}
-			if $opt->{compare};
-		if($opt->{compare}) {
+		eval { 
+			$qr = qr{$opt->{compare}} if $opt->{compare};
+		};
+		if($qr) {
 			$sub = sub { 
 							$_[0] =~ $qr;
 						};