In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/2cc6a9db5a91276f3ff662b3e5befa6799fde3ed?hp=a60c8fb1669c9e83f4a7dc153b8baeee32187d8d>

- Log -----------------------------------------------------------------
commit 2cc6a9db5a91276f3ff662b3e5befa6799fde3ed
Author: Karl Williamson <[email protected]>
Date:   Mon Mar 9 12:18:27 2015 -0600

    t/loc_tools.pl: Fix bug with locale tests in win32
    
    This bug was introduced by commit
    128e4113466e835078eb016709e5d23b86be3120.
    
    Win32 doesn't have an LC_MESSAGES, so calls using that name failed.
-----------------------------------------------------------------------

Summary of changes:
 t/loc_tools.pl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/t/loc_tools.pl b/t/loc_tools.pl
index 9e4320b..ae8ff64 100644
--- a/t/loc_tools.pl
+++ b/t/loc_tools.pl
@@ -79,9 +79,15 @@ sub _decode_encodings {
 my %category_name;
 eval { require POSIX; import POSIX 'locale_h'; };
 unless ($@) {
+    my $number_for_missing_category = 0;
     foreach my $name (qw(ALL COLLATE CTYPE MESSAGES MONETARY NUMERIC TIME)) {
         my $number = eval "&POSIX::LC_$name";
-        next if $@;
+
+        # Use a negative number if the platform doesn't support this category,
+        # so we have an entry for all ones that might be specified in calls to
+        # us.
+        $number = --$number_for_missing_category if $@;
+
         $category_name{$number} = "$name";
     }
 }

--
Perl5 Master Repository

Reply via email to