From 88d55cb347b1e337654bbded54af1c6099d4e7f0 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 12 Apr 2021 05:13:25 -0600 Subject: [PATCH] t/loc_tools.pl: Check for unsupported locales This commit causes us not to view unsupported locales as legitimate for testing. Core dumps occurred on some platforms without this. It looks for a diagnostic that the next commit in this series will generate. --- t/loc_tools.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/loc_tools.pl b/t/loc_tools.pl index 3017c90fefb9..e39406960e78 100644 --- a/t/loc_tools.pl +++ b/t/loc_tools.pl @@ -148,11 +148,13 @@ ($$$$) my $badutf8 = 0; my $plays_well = 1; + my $unsupported = 0; use warnings 'locale'; local $SIG{__WARN__} = sub { $badutf8 = 1 if grep { /Malformed UTF-8/ } @_; + $unsupported = 1 if grep { /Locale .* is unsupported/i } @_; $plays_well = 0 if grep { /Locale .* may not work well(?# )|The Perl program will use the expected meanings/i @@ -187,6 +189,8 @@ ($$$$) return; } + return if $unsupported; + # Commas in locale names are bad in Windows, and there is a bug in # some versions where setlocale() turns a legal input locale name into # an illegal return value, which it can't later parse.