Add PERLIO_INIT and PERLIO_TERM to PERL_SYS_INIT* and PERL_SYS_TERM*
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index 6be13df..d9fde3e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4303,10 +4303,13 @@ Perl_upg_version(pTHX_ SV *ver)
     if ( SvNOK(ver) ) /* may get too much accuracy */ 
     {
        char tbuf[64];
-       STRLEN len;
-       SET_NUMERIC_STANDARD();
-       len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
-       SET_NUMERIC_LOCAL();
+#ifdef USE_LOCALE_NUMERIC
+       char *loc = setlocale(LC_NUMERIC, "C");
+#endif
+       STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+       setlocale(LC_NUMERIC, loc);
+#endif
        while (tbuf[len-1] == '0' && len > 0) len--;
        version = savepvn(tbuf, len);
     }
@@ -5472,7 +5475,7 @@ Perl_my_clearenv(pTHX)
     char *buf = (char*)safesysmalloc(bufsiz);
     while (*environ != NULL) {
       char *e = strchr(*environ, '=');
-      int l = e ? e - *environ : strlen(*environ);
+      int l = e ? e - *environ : (int)strlen(*environ);
       if (bsiz < l + 1) {
         (void)safesysfree(buf);
         bsiz = l + 1; /* + 1 for the \0. */