Skip to content

Commit

Permalink
locale.c: Use function already designed for the purpose
Browse files Browse the repository at this point in the history
Instead of several initialization calls, call the overarching one that
includes them all.
  • Loading branch information
khwilliamson committed May 22, 2023
1 parent aeb8ee0 commit 3a0d918
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions locale.c
Expand Up @@ -6562,26 +6562,27 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
uselocale(PL_C_locale_obj);


/* Now initialize some data structures. This is entirely so that
* later-executed code doesn't have to concern itself with things not being
* initialized. Arbitrarily use the C locale (which we know has to exist
* on the system). */

# endif
# ifdef USE_LOCALE_NUMERIC

PL_numeric_radix_sv = newSV(1);
PL_underlying_radix_sv = newSV(1);
Newxz(PL_numeric_name, 1, char); /* Single NUL character */
new_numeric("C", false);

# endif
# ifdef USE_LOCALE_COLLATE

Newxz(PL_collation_name, 1, char);
new_collate("C", false);

# endif
# ifdef USE_LOCALE_CTYPE

Newxz(PL_ctype_name, 1, char);
new_ctype("C", false);

# endif
# ifdef USE_PL_CURLOCALES
Expand All @@ -6592,6 +6593,8 @@ Perl_init_i18nl10n(pTHX_ int printwarn)

# endif

new_LC_ALL(NULL, true /* Don't shortcut */);

/*===========================================================================*/

/* Now ready to override the initialization with the values that the user
Expand Down

0 comments on commit 3a0d918

Please sign in to comment.