X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/1b30b4a8259a74c5ffaee362bc1d881c40fc5279..d3a5b29c73b5a2fd6524ca1f8c5c779bd8cb0687:/vutil.c?ds=sidebyside diff --git a/vutil.c b/vutil.c index a66d6ef..a3f11be 100644 --- a/vutil.c +++ b/vutil.c @@ -620,7 +620,7 @@ VER_NV: #endif #ifdef USE_LOCALE_NUMERIC - { + { /* This may or may not be called from code that has switched * locales without letting perl know, therefore we have to find it * from first principals. See [perl #121930]. */ @@ -666,8 +666,8 @@ VER_NV: else { /* This value indicates to the restore code that we didn't change the locale */ locale_name_on_entry = NULL; - } - } + } + } else if (locale_obj_on_entry == PL_underlying_numeric_obj) { /* Here, the locale appears to have been changed to use the * program's underlying locale. Just use our mechanisms to @@ -692,15 +692,15 @@ VER_NV: #endif - if (sv) { - Perl_sv_catpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver)); - len = SvCUR(sv); - buf = SvPVX(sv); - } - else { - len = my_snprintf(tbuf, sizeof(tbuf), "%.9" NVff, SvNVX(ver)); - buf = tbuf; - } + if (sv) { + Perl_sv_catpvf(aTHX_ sv, "%.9"NVff, SvNVX(ver)); + len = SvCUR(sv); + buf = SvPVX(sv); + } + else { + len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver)); + buf = tbuf; + } #ifdef USE_LOCALE_NUMERIC @@ -725,7 +725,7 @@ VER_NV: } else if (locale_obj_on_entry != PL_C_locale_obj) { uselocale(locale_obj_on_entry); - } + } # endif @@ -989,11 +989,11 @@ Perl_vnormal(pTHX_ SV *vs) SV * tsv = *av_fetch(av, 0, 0); digit = SvIV(tsv); } - sv = Perl_newSVpvf(aTHX_ "v%" IVdf, (IV)digit); + sv = Perl_newSVpvf(aTHX_ "v%"IVdf, (IV)digit); for ( i = 1 ; i <= len ; i++ ) { SV * tsv = *av_fetch(av, i, 0); digit = SvIV(tsv); - Perl_sv_catpvf(aTHX_ sv, ".%" IVdf, (IV)digit); + Perl_sv_catpvf(aTHX_ sv, ".%"IVdf, (IV)digit); } if ( len <= 2 ) { /* short version, must be at least three */