Skip to content

Commit

Permalink
define numeric values to be C when no USE_NUMERIC
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Nov 22, 2023
1 parent 9803ed4 commit d79d8ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions locale.c
Expand Up @@ -7837,6 +7837,12 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
PL_underlying_radix_sv = newSV(1);
Newxz(PL_numeric_name, 1, char); /* Single NUL character */

# else

PL_numeric_radix_sv = newSVpv(C_decimal_point, 0);
PL_underlying_radix_sv = newSVpv(C_decimal_point, 0);
NewCopy("C", PL_numeric_name, 2, char);

# endif
# ifdef USE_LOCALE_COLLATE

Expand Down
2 changes: 0 additions & 2 deletions perl.c
Expand Up @@ -1165,14 +1165,12 @@ perl_destruct(pTHXx)
PL_scratch_locale_obj = NULL;
}
#endif
#ifdef USE_LOCALE_NUMERIC
Safefree(PL_numeric_name);
PL_numeric_name = NULL;
SvREFCNT_dec(PL_numeric_radix_sv);
PL_numeric_radix_sv = NULL;
SvREFCNT_dec(PL_underlying_radix_sv);
PL_underlying_radix_sv = NULL;
#endif
#ifdef USE_LOCALE_CTYPE
Safefree(PL_ctype_name);
PL_ctype_name = NULL;
Expand Down
1 change: 1 addition & 0 deletions sv.c
Expand Up @@ -16094,6 +16094,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
#endif

#ifdef USE_LOCALE_NUMERIC
// SAVEPV?
PL_numeric_name = SAVEPV("C");
PL_numeric_radix_sv = newSVpvs(".");
PL_underlying_radix_sv = newSVpvs(".");
Expand Down

0 comments on commit d79d8ad

Please sign in to comment.