This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for bug #37714: XSUB.h version check may fail due to locale
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 14 Sep 2006 15:31:22 +0000 (15:31 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 14 Sep 2006 15:31:22 +0000 (15:31 +0000)
Always convert version to number under C locale settings

p4raw-id: //depot/perl@28847

util.c

diff --git a/util.c b/util.c
index 88e7812..da53fa4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4319,7 +4319,9 @@ Perl_upg_version(pTHX_ SV *ver)
     if ( SvNOK(ver) ) /* may get too much accuracy */ 
     {
        char tbuf[64];
+       SET_NUMERIC_STANDARD();
        STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
+       SET_NUMERIC_LOCAL();
        while (tbuf[len-1] == '0' && len > 0) len--;
        version = savepvn(tbuf, len);
     }