diff options
author | Karl Williamson <khw@cpan.org> | 2022-08-24 20:47:55 -0600 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2022-08-25 09:01:07 -0400 |
commit | be552ced7556db8582622a745067e1b266e8ca91 (patch) | |
tree | cf45c135b6c9391c0ecdf57ca528bf0edaafadc2 /t/run | |
parent | 33ef5d2cdf69f4a7b22ff4c220758689b59b28a8 (diff) | |
download | perl-be552ced7556db8582622a745067e1b266e8ca91.tar.gz |
run/locale.t: skip illegal locale test when all are legal
OpenBSD believes that locales are so inherently insecure that it only
internally has two locales: C and C.UTF-8, which it knows how to treat
securely.
However, to preserve at least the illusion of portability, the locale
setting operations do not fail whatever garbage is passed as the locale
name. (There may be unacceptable strings, but any reasonable locale
name and a lot of unreasonable ones are accepted.) If the input name
looks like it was meant to have "UTF-8" in its name, the locale is set
to C.UTF-8. Otherwise, it is set to C. Early releases had bugs in
switching between the two.
I wrote a Configure probe some years ago to detect this situation.
I forgot about this fact in adapting Bram's test case. It should be
skipped on such platforms.
This fixes #20149
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/locale.t | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/run/locale.t b/t/run/locale.t index 00a72fa5da..d42cca9de7 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -571,6 +571,10 @@ SKIP: { # GH #20085 } SKIP: { # GH #20054 + skip "Even illegal locale names are accepted", 1 + if $Config{d_setlocale_accepts_any_locale_name} + && $Config{d_setlocale_accepts_any_locale_name} eq 'define'; + my @lc_all_locales = find_locales('LC_ALL'); my $locale = $lc_all_locales[0]; skip "LC_ALL not enabled on this platform", 1 unless $locale; |