Broken argument parsing in Lexicon::import().
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
liblocale-maketext-lexicon-perl (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The Locale:
> Locale:
While trying to check if the number of arguments is *even*, the import() function actually checks if an *odd* number of arguments was passed. From /usr/share/
> sub import {
> my $class = shift;
> return unless @_;
>
> my %entries;
> if (UNIVERSAL:
> # a hashref with $lang as keys, [$format, $src ...] as values
> %entries = %{$_[0]};
> }
> elsif (@_ % 2) {
> %entries = ( '' => [ @_ ] );
> }
The elsif statement on line 222 should read:
> elsif (@_ % 2 == 0) {
> %entries = ( '' => [ @_ ] );
> }
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
$ apt-cache policy liblocale-
liblocale-
Installed: 0.53-1
Candidate: 0.53-1
Version table:
*** 0.53-1 0
500 http://
100 /var/lib/
Thanks.
The bug is known and solved upstream (see version 0.77 of the Locale: :Maketext: :Lexicon on cpan http:// search. cpan.org/ ~drtech/ Locale- Maketext- Lexicon- 0.77/