Subject: | WAP::wbxml converts attribute values of "0" to "" in compileAttributeValues() |
Date: | Fri, 7 Jan 2011 11:24:22 -0800 |
To: | bug-WAP-wbxml [...] rt.cpan.org |
From: | Jason Simpson <jsimpson [...] real.com> |
Distribution: WAP-wbxml-1.11-1bBT2T
Perl version(s):
v5.8.8 built for x86_64-linux-thread-multi
v5.10.0 built for i486-linux-gnu-thread-multi
OS(es):
Linux 2.6.18-164.15.1.el5 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
Linux 2.6.31-22-generic #67-Ubuntu SMP i686 GNU/Linux
-----
Description:
If the value of an attribute is "0", the postfix-if on the
compilePreserveStringI() calls evaluates to false. These tests should probably
be on definedness, not on the value itself.
-----
Patch that seems to work for me:
--- old/wbxml.pm 2007-10-25 06:06:04.000000000 -0700
+++ new/wbxml.pm 2011-01-07 11:02:11.000000000 -0800
@@ -380,11 +380,11 @@
while (1) {
($attr, $start, $end) = $self->{rulesApp}->getAttrValue($value,
$self->{attrCodepage});
last unless ($attr);
- $self->compilePreserveStringI($start) if ($start);
+ $self->compilePreserveStringI($start) if (defined $start);
$self->compileAttributeExtToken($attr->{ext_token});
$value = $end;
}
- $self->compilePreserveStringI($start) if ($start);
+ $self->compilePreserveStringI($start) if (defined $start);
}
sub compileProcessingInstruction {