From 6a4065f28f30d59e3a6cea6504be34bdb5e5eb8b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 3 Oct 2022 08:33:55 -0600 Subject: locale: Create special variable to hold current LC_ALL Some configurations require us to store the current locale for each category. Prior to this commit, this was done in the array PL_curlocales, with the entry for LC_ALL being in the highest element. Future commits will need just the value for LC_ALL in some other configurations, without needing the rest of the array. This commit splits off the LC_ALL element into its own per-interpreter variable to accommodate those. It always had to have special handling anyway beyond the rest of the array elements, --- perl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'perl.c') diff --git a/perl.c b/perl.c index 9fae6874da..0a3ec39811 100644 --- a/perl.c +++ b/perl.c @@ -1140,6 +1140,17 @@ perl_destruct(pTHXx) freelocale(old_locale); } } + +# ifdef USE_PL_CUR_LC_ALL + + if (PL_cur_LC_ALL) { + DEBUG_L( PerlIO_printf(Perl_debug_log, "PL_cur_LC_ALL=%p\n", PL_cur_LC_ALL)); + Safefree(PL_cur_LC_ALL); + PL_cur_LC_ALL = NULL; + } + +# endif + if (PL_scratch_locale_obj) { freelocale(PL_scratch_locale_obj); PL_scratch_locale_obj = NULL; -- cgit v1.2.1