The #6648 wasn't protective enough for limited platforms
Jarkko Hietaniemi [Thu, 17 Aug 2000 19:16:13 +0000 (19:16 +0000)]
(like microperl).

p4raw-id: //depot/perl@6678

dump.c
sv.c

diff --git a/dump.c b/dump.c
index d0190f5..0037daf 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -279,12 +279,9 @@ Perl_sv_peek(pTHX_ SV *sv)
        }
     }
     else if (SvNOKp(sv)) {
-       bool was_local = PL_numeric_local;
-       if (!was_local)
-           SET_NUMERIC_STANDARD();
+       STORE_NUMERIC_LOCAL_SET_STANDARD();
        Perl_sv_catpvf(aTHX_ t, "(%g)",SvNVX(sv));
-       if (was_local)
-           SET_NUMERIC_LOCAL();
+       RESTORE_NUMERIC_LOCAL();
     }
     else if (SvIOKp(sv)) {
        if (SvIsUV(sv))
@@ -932,17 +929,14 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        PerlIO_putc(file, '\n');
     }
     if (type >= SVt_PVNV || type == SVt_NV) {
-       bool was_local = PL_numeric_local;
-       if (!was_local)
-           SET_NUMERIC_STANDARD();
+       STORE_NUMERIC_LOCAL_SET_STANDARD();
        /* %Vg doesn't work? --jhi */
 #ifdef USE_LONG_DOUBLE
        Perl_dump_indent(aTHX_ level, file, "  NV = %.*" PERL_PRIgldbl "\n", LDBL_DIG, SvNVX(sv));
 #else
        Perl_dump_indent(aTHX_ level, file, "  NV = %.*g\n", DBL_DIG, SvNVX(sv));
 #endif
-       if (was_local)
-           SET_NUMERIC_LOCAL();
+       RESTORE_NUMERIC_LOCAL();
     }
     if (SvROK(sv)) {
        Perl_dump_indent(aTHX_ level, file, "  RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv)));
diff --git a/sv.c b/sv.c
index 2e59dce..9e77330 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6556,8 +6556,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
 
            {
                STORE_NUMERIC_STANDARD_SET_LOCAL();
+#ifdef USE_LOCALE_NUMERIC
                if (!was_standard && maybe_tainted)
                    *maybe_tainted = TRUE;
+#endif
                (void)sprintf(PL_efloatbuf, eptr, nv);
                RESTORE_NUMERIC_STANDARD();
            }