[interchange-cvs] interchange - jon modified lib/Vend/Interpolate.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Tue Oct 30 13:58:00 2001
User: jon
Date: 2001-10-30 18:57:35 GMT
Modified: lib/Vend Interpolate.pm
Log:
Log error when invalid parameters given in [loop list=`...`].
Add missing match count setting Mike found.
Revision Changes Path
2.25 +7 -2 interchange/lib/Vend/Interpolate.pm
rev 2.25, prev_rev 2.24
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -u -r2.24 -r2.25
--- Interpolate.pm 2001/10/26 00:17:32 2.24
+++ Interpolate.pm 2001/10/30 18:57:35 2.25
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.24 2001/10/26 00:17:32 edl Exp $
+# $Id: Interpolate.pm,v 2.25 2001/10/30 18:57:35 jon Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.24 $, 10);
+$VERSION = substr(q$Revision: 2.25 $, 10);
@EXPORT = qw (
@@ -5625,8 +5625,13 @@
# [/loop]
if (ref $list) {
#::logDebug("opt->list in: " . ::uneval($list) );
+ unless (ref $list eq 'ARRAY' and ref $list->[0] eq 'ARRAY') {
+ ::logError("loop was passed invalid list=`...` argument");
+ return;
+ }
my ($ary, $fh, $fa) = @$list;
$opt->{object}{mv_results} = $ary;
+ $opt->{object}{matches} = scalar @$ary;
$opt->{object}{mv_field_names} = $fa if $fa;
$opt->{object}{mv_field_hash} = $fh if $fh;
return region($opt, $text);