This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix t/loc_tools.pl
authorKarl Williamson <khw@cpan.org>
Tue, 10 Mar 2015 20:52:08 +0000 (14:52 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 13 Mar 2015 02:10:32 +0000 (20:10 -0600)
commite6965c14693b6cad1c65f3a588597285a0e525a2
tree93a3d1ece55019169bd5e2dffaf8a9041c26d646
parent22bc8aa4322ef10da30c6535091a327b3b904c34
Fix t/loc_tools.pl

Commit 128e4113466e835078eb016709e5d23b86be3120 introduced a bug which
causes a failure only on netbsd.  It failed to make a copy in a function
of the array whose reference is passed into it, and then modified the
elements, thus changing the original.  I think what this does on other
platforms is to cause locales to be skipped from being tested (which is
wrong but doesn't show up as a test failure), but on netbsd, it appears
to expose a bug in their setlocale implementation, in which when
setlocale is called with an invalid category, it succeeds instead of
fails.

Another bug in that commit was fixed by
2cc6a9db5a91276f3ff662b3e5befa6799fde3ed.  But that fix introduced yet
another bug, by extending category numbers to be negative (when a given
category doesn't actually exist on a platform) but failing to allow for
a minus sign in the regex pattern that should match any such number.
This problem showed up on vms and os390.

This commit fixes both problems.
t/loc_tools.pl