Skip to content

Commit

Permalink
XXX tests: sync_locale() Make sure to get info from global locale
Browse files Browse the repository at this point in the history
This function is supposed to copy the global locale state to the
per-thread one, but until this commit, if the current locale being used
was the per-thread one, it would be a no-op.  This is an edge case that
rarely would occur in practice, as the point of this function is when
you are in the global locale, so wouldn't generally be called otherwise.
But it should handle the edge case properly.
  • Loading branch information
khwilliamson committed Jan 27, 2023
1 parent ae3d5de commit 697b432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locale.c
Expand Up @@ -7227,7 +7227,7 @@ Perl_sync_locale(pTHX)

# elif defined(USE_POSIX_2008_LOCALE)

was_in_global = (LC_GLOBAL_LOCALE == uselocale((locale_t) 0));
was_in_global = (LC_GLOBAL_LOCALE == uselocale(LC_GLOBAL_LOCALE));

# else
# error Unexpected Configuration
Expand Down

0 comments on commit 697b432

Please sign in to comment.