Skip to content

Commit

Permalink
t/loc_tools.pl: Update text for searched for diagnostic
Browse files Browse the repository at this point in the history
This fixes #21113.

This script looks for locales that have no idiosyncracies.  It excludes
ones that generate warnings that there are potential issues with them.
However, commit 667fa5f changed the
warning text, without updating this script with the new text.  Hence,
problematic locales were let through.

Simply update the searched-for text now, and add a cross-referencing
comment to where the text is generated to keep this from happening
again.

The problem in this ticket is that a locale chosen on this platform
happens to have idiosyncracies.  Other platforms happen to currently
choose different locales that aren't problematic.  This change keeps any
problematic locale from being chosen.
  • Loading branch information
khwilliamson committed May 26, 2023
1 parent 387db90 commit fd785c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions locale.c
Expand Up @@ -2424,6 +2424,9 @@ S_new_ctype(pTHX_ const char *newctype, bool force)
if ( (UNLIKELY(bad_count))
&& (LIKELY(ckWARN_d(WARN_LOCALE)) || UNLIKELY(DEBUG_L_TEST)))
{
/* WARNING. If you change the wording of these; be sure to update
* t/loc_tools.pl correspondingly */

if (PL_in_utf8_CTYPE_locale) {
PL_warn_locale = Perl_newSVpvf(aTHX_
"Locale '%s' contains (at least) the following characters"
Expand Down
2 changes: 1 addition & 1 deletion t/loc_tools.pl
Expand Up @@ -180,7 +180,7 @@ ($$$$)
$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 following characters .* may not have the same meaning as the Perl program expects(?#
)|The Perl program will use the expected meanings/i
} @_;
};
Expand Down

0 comments on commit fd785c1

Please sign in to comment.