[interchange-cvs] interchange - heins modified
lib/Vend/Interpolate.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sun Oct 5 16:09:24 EDT 2003
User: heins
Date: 2003-10-05 19:09:23 GMT
Modified: lib/Vend Interpolate.pm
Log:
* Fix nested [elsif] problem.
Revision Changes Path
2.193 +9 -4 interchange/lib/Vend/Interpolate.pm
rev 2.193, prev_rev 2.192
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.192
retrieving revision 2.193
diff -u -r2.192 -r2.193
--- Interpolate.pm 19 Sep 2003 03:27:59 -0000 2.192
+++ Interpolate.pm 5 Oct 2003 19:09:23 -0000 2.193
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.192 2003/09/19 03:27:59 mheins Exp $
+# $Id: Interpolate.pm,v 2.193 2003/10/05 19:09:23 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.192 $, 10);
+$VERSION = substr(q$Revision: 2.193 $, 10);
@EXPORT = qw (
@@ -1546,8 +1546,13 @@
}
elsif ($elsif) {
$else = '[else]' . $else . '[/else]' if length $else;
- $elsif =~ s#(.*?)$QR{'/elsif'}(.*)#$1${2}[/elsif]#s;
- $out = '[if ' . $elsif . $else . '[/if]';
+ my $pertinent = Vend::Parse::find_matching_end('elsif', \$elsif);
+ unless(defined $pertinent) {
+ $pertinent = $elsif;
+ $elsif = '';
+ }
+ $elsif .= '[/elsif]' if $elsif =~ /\S/;
+ $out = '[if ' . $pertinent . $elsif . $else . '[/if]';
}
elsif (length $else) {
$out = $else;
More information about the interchange-cvs
mailing list