Skip to content

Commit

Permalink
final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Nov 20, 2023
1 parent 5999ec2 commit ceaaa1b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions locale.c
Expand Up @@ -2,6 +2,11 @@
*
123456789112345678921234567893123456789412345678951234567896123456789712345678981
* strptime
* NO_USE_LOCALE_foo is not the same as no LC_foo
* what deltas for stdize changes?
subroutines in this file, so as to reorder them
* a bunch of copies aren't needed on nonthreaded
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
* 2002, 2003, 2005, 2006, 2007, 2008 by Larry Wall and others
*
Expand Down Expand Up @@ -88,7 +93,7 @@
* 1) Raw posix_setlocale(). This implementation is basically the libc
* setlocale(), with possibly minor tweaks. This is used for startup, and
* always for unthreaded perls, and when the API for safe locale threading
* is identical to the unsafe API (Windows, currently).
* is XXX identical to the unsafe API (Windows, currently).
*
* This implementation is composed of two layers:
* a) posix_setlocale() implements the libc setlocale(). In most cases,
Expand Down Expand Up @@ -3583,7 +3588,8 @@ S_find_locale_from_environment(pTHX_ const locale_category_index index)
/* For each desired category, use any corresponding environment variable;
* or the default if none such exists. */
bool is_disparate = false; /* Assume is uniform until proven otherwise */
for (unsigned i = lower; i <= upper; i++) {
// XXX i should be locale_category_index
for (unsigned int i = lower; i <= upper; i++) {
const char * const env_override = PerlEnv_getenv(category_names[i]);
unsigned int j = i - offset;

Expand Down Expand Up @@ -3906,6 +3912,7 @@ Perl_set_numeric_standard(pTHX_ const char * const file, const line_t line)
DEBUG_L(PerlIO_printf(Perl_debug_log, "Setting LC_NUMERIC locale to"
" standard C; called from %s: %"
LINE_Tf "\n", file, line));
/* XXX Maybe not in init? assert(PL_locale_mutex_depth > 0);*/

void_setlocale_c_with_caller(LC_NUMERIC, "C", file, line);
PL_numeric_standard = TRUE;
Expand Down Expand Up @@ -3938,7 +3945,7 @@ Perl_set_numeric_underlying(pTHX_ const char * const file, const line_t line)
DEBUG_L(PerlIO_printf(Perl_debug_log, "Setting LC_NUMERIC locale to %s;"
" called from %s: %" LINE_Tf "\n",
PL_numeric_name, file, line));
/* Maybe not in init? assert(PL_locale_mutex_depth > 0);*/
/* XXX Maybe not in init? assert(PL_locale_mutex_depth > 0);*/

void_setlocale_c_with_caller(LC_NUMERIC, PL_numeric_name, file, line);
PL_numeric_underlying = TRUE;
Expand Down Expand Up @@ -4640,6 +4647,9 @@ S_win32_setlocale(pTHX_ int category, const char* locale)

Safefree(PL_cur_LC_ALL);
PL_cur_LC_ALL = result;

DEBUG_L(PerlIO_printf(Perl_debug_log, "new PL_cur_LC_ALL=%s\n",
PL_cur_LC_ALL));
}

DEBUG_L(PerlIO_printf(Perl_debug_log, "new PL_cur_LC_ALL=%s\n",
Expand Down

0 comments on commit ceaaa1b

Please sign in to comment.