This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/loc_tools.pl: No setlocale when no locales
authorKarl Williamson <khw@cpan.org>
Sat, 13 Apr 2019 18:04:29 +0000 (12:04 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 13 Apr 2019 18:16:11 +0000 (12:16 -0600)
Don't call this function unconditionally.  There may be no locale
handling available, so check that first.

t/loc_tools.pl

index 2d35c59..c76e293 100644 (file)
@@ -569,6 +569,8 @@ sub find_utf8_turkic_locales (;$) {
 
     my @return;
 
+    return unless locales_enabled('LC_CTYPE');
+
     my $save_locale = setlocale(&POSIX::LC_CTYPE());
     foreach my $locale (find_utf8_ctype_locales(shift)) {
         use locale;