X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=locale.c;h=d90b5574474c67397dc7321e88e19466f7b9ece8;hb=f29b885a606ebcae8bf384c16eb4affebb332ccc;hp=f9b2c9350c120ba469c11489f61986f231520485;hpb=6cb43dbf7021a8e1f9508dae05534be11e07948d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/locale.c b/locale.c index f9b2c93..d90b557 100644 --- a/locale.c +++ b/locale.c @@ -284,6 +284,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) } if (!setlocale_failure) { #ifdef USE_LOCALE_CTYPE + Safefree(curctype); if (! (curctype = setlocale(LC_CTYPE, (!done && (lang || PerlEnv_getenv("LC_CTYPE"))) @@ -293,6 +294,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) curctype = savepv(curctype); #endif /* USE_LOCALE_CTYPE */ #ifdef USE_LOCALE_COLLATE + Safefree(curcoll); if (! (curcoll = setlocale(LC_COLLATE, (!done && (lang || PerlEnv_getenv("LC_COLLATE"))) @@ -302,6 +304,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) curcoll = savepv(curcoll); #endif /* USE_LOCALE_COLLATE */ #ifdef USE_LOCALE_NUMERIC + Safefree(curnum); if (! (curnum = setlocale(LC_NUMERIC, (!done && (lang || PerlEnv_getenv("LC_NUMERIC"))) @@ -458,12 +461,15 @@ Perl_init_i18nl10n(pTHX_ int printwarn) #endif /* ! LC_ALL */ #ifdef USE_LOCALE_CTYPE + Safefree(curctype); curctype = savepv(setlocale(LC_CTYPE, NULL)); #endif /* USE_LOCALE_CTYPE */ #ifdef USE_LOCALE_COLLATE + Safefree(curcoll); curcoll = savepv(setlocale(LC_COLLATE, NULL)); #endif /* USE_LOCALE_COLLATE */ #ifdef USE_LOCALE_NUMERIC + Safefree(curnum); curnum = savepv(setlocale(LC_NUMERIC, NULL)); #endif /* USE_LOCALE_NUMERIC */ } @@ -537,6 +543,8 @@ Perl_init_i18nl10n(pTHX_ int printwarn) { const char *p = PerlEnv_getenv("PERL_UNICODE"); PL_unicode = p ? parse_unicode_opts(&p) : 0; + if (PL_unicode & PERL_UNICODE_UTF8CACHEASSERT_FLAG) + PL_utf8cache = -1; } #endif