Permalink
Browse files

locale.c: Avoid duplicate work

As the comments say, the needed value is already readily available
  • Loading branch information...
khwilliamson committed Jan 2, 2018
1 parent 9cc5600 commit 398f2443ef2f77f8b6b688354a6070de230c3f4b
Showing with 6 additions and 5 deletions.
  1. +6 −5 locale.c
View
@@ -2370,11 +2370,12 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
# if defined(USE_PERLIO) && defined(USE_LOCALE_CTYPE)
/* Set PL_utf8locale to TRUE if using PerlIO _and_ the current LC_CTYPE
* locale is UTF-8. If PL_utf8locale and PL_unicode (set by -C or by
* $ENV{PERL_UNICODE}) are true, perl.c:S_parse_body() will turn on the
* PerlIO :utf8 layer on STDIN, STDOUT, STDERR, _and_ the default open
* discipline. */
PL_utf8locale = _is_cur_LC_category_utf8(LC_CTYPE);
* locale is UTF-8. The call to new_ctype() just above has already
* calculated the latter value and saved it in PL_in_utf8_CTYPE_locale. If
* both PL_utf8locale and PL_unicode (set by -C or by $ENV{PERL_UNICODE})
* are true, perl.c:S_parse_body() will turn on the PerlIO :utf8 layer on
* STDIN, STDOUT, STDERR, _and_ the default open discipline. */
PL_utf8locale = PL_in_utf8_CTYPE_locale;
/* Set PL_unicode to $ENV{PERL_UNICODE} if using PerlIO.
This is an alternative to using the -C command line switch

0 comments on commit 398f244

Please sign in to comment.