File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -4157,8 +4157,10 @@ S_new_ctype(pTHX_ const char *newctype, bool force)
4157
4157
* */
4158
4158
4159
4159
LC_CTYPE_LOCK ;
4160
+ const int mb_cur_max = MB_CUR_MAX ;
4161
+ LC_CTYPE_UNLOCK ;
4160
4162
4161
- if (MB_CUR_MAX > 1 && ! PL_in_utf8_CTYPE_locale
4163
+ if (mb_cur_max > 1 && ! PL_in_utf8_CTYPE_locale
4162
4164
4163
4165
/* Some platforms return MB_CUR_MAX > 1 for even the "C" locale.
4164
4166
* Just assume that the implementation for them (plus for POSIX) is
@@ -4167,19 +4169,14 @@ S_new_ctype(pTHX_ const char *newctype, bool force)
4167
4169
* as this is the only problem, everything should work fine */
4168
4170
&& ! isNAME_C_OR_POSIX (newctype ))
4169
4171
{
4170
- LC_CTYPE_UNLOCK ;
4171
-
4172
4172
DEBUG_L (PerlIO_printf (Perl_debug_log ,
4173
- "Unsupported, MB_CUR_MAX=%d\n" , ( int ) MB_CUR_MAX ));
4173
+ "Unsupported, MB_CUR_MAX=%d\n" , mb_cur_max ));
4174
4174
4175
4175
Perl_ck_warner_d (aTHX_ packWARN (WARN_LOCALE ),
4176
4176
"Locale '%s' is unsupported, and may crash the"
4177
4177
" interpreter.\n" ,
4178
4178
newctype );
4179
4179
}
4180
- else {
4181
- LC_CTYPE_UNLOCK ;
4182
- }
4183
4180
4184
4181
# endif
4185
4182
You can’t perform that action at this time.
0 commit comments