From 2371cc83c528d780f0114017aaea867c0dff008c Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 21 Nov 2015 12:20:32 -0700 Subject: Get re/uniprops.t to pass on minitest locale handling doesn't work without POSIX module being able to load, so doesn't work on minitest. Prior to this patch, the code checked for only one case of locale handling to skip when there was no POSIX, but there was a 2nd case if failed to detect. --- lib/unicore/mktables | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 3105e9a46d..4fd5541a16 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -19544,10 +19544,16 @@ utf8::upgrade($breakable_utf8); my $nobreak_utf8 = my $nobreak = chr(utf8::unicode_to_native(0xD7)); utf8::upgrade($nobreak_utf8); +my $are_ctype_locales_available; my $utf8_locale; chdir 't' if -d 't'; eval { require "./loc_tools.pl" }; -$utf8_locale = &find_utf8_ctype_locale if defined &find_utf8_ctype_locale; +if (defined &locales_enabled) { + $are_ctype_locales_available = locales_enabled('LC_CTYPE'); + if ($are_ctype_locales_available) { + $utf8_locale = &find_utf8_ctype_locale; + } +} sub _test_break($$) { # Test various break property matches. The 2nd parameter gives the @@ -19627,9 +19633,13 @@ sub _test_break($$) { $display_upgrade = " (utf8-upgraded)"; } - # The /l modifier has C after it to indicate the locale to try - my @modifiers = qw(a aa d lC u i); - push @modifiers, "l$utf8_locale" if defined $utf8_locale; + my @modifiers = qw(a aa d u i); + if ($are_ctype_locales_available) { + push @modifiers, "l" if defined &find_utf8_ctype_locale; + + # The /l modifier has C after it to indicate the locale to try + push @modifiers, "lC"; + } # Test for each of the regex modifiers. for my $modifier (@modifiers) { -- cgit v1.2.1