diff options
author | Karl Williamson <khw@cpan.org> | 2021-02-11 12:33:23 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-08-09 18:05:59 -0600 |
commit | 827a4a051afa67d6b91304bc64744af3072038aa (patch) | |
tree | e7f1d7e1d38bd36e7bd230b54909efdb6f9f5217 /sv.c | |
parent | c6efbad02ab04568fbee498752817f20f3124611 (diff) | |
download | perl-827a4a051afa67d6b91304bc64744af3072038aa.tar.gz |
locale.c: Add fcn to hide edge case undefined behavior
The POSIX 2008 API has an edge case in that the result of most of the
functions when called with a global (as opposed to a per-thread) locale
is undefined.
The duplocale() function is the exception which will create a per-thread
locale containing the values copied from the global one.
This commit just calls duplocale, if needed, and the caller need not
concern itself with this possibility
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -15845,6 +15845,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_underlying_numeric_obj = NULL; # endif #endif /* !USE_LOCALE_NUMERIC */ +#if defined(USE_POSIX_2008_LOCALE) + PL_scratch_locale_obj = NULL; +#endif #ifdef HAS_MBRLEN PL_mbrlen_ps = proto_perl->Imbrlen_ps; |