diff options
author | Karl Williamson <khw@cpan.org> | 2014-06-01 20:07:30 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-06-05 11:23:00 -0600 |
commit | 7738054cc936a59cb4b0e0da328f287c9ec8a98a (patch) | |
tree | da7267d8e7c56b3ca5721129f5931aab591493dd /vutil.c | |
parent | aaaeb2977e88223f68d9f7a7009ef4cf1f735c72 (diff) | |
download | perl-7738054cc936a59cb4b0e0da328f287c9ec8a98a.tar.gz |
Allow dynamic lock of LC_NUMERIC
When processing version strings, the radix character must be a dot even
if we otherwise would be using some other character. vutil.c
upg_version() changes to the dot, but calls sv_catpvf() which may try to
change the character to something else. This commit introduces a way to
lock the character to a dot around the call to sv_catpvf()
vutil.c is cpan-upstream, but already blead and cpan have diverged, so
this just updates the SHA of the new version
Diffstat (limited to 'vutil.c')
-rw-r--r-- | vutil.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -590,6 +590,7 @@ VER_NV: SV *sv = SvNVX(ver) > 10e50 ? newSV(64) : 0; char *buf; STORE_NUMERIC_LOCAL_SET_STANDARD(); + LOCK_NUMERIC_STANDARD(); if (sv) { Perl_sv_catpvf(aTHX_ sv, "%.9"NVff, SvNVX(ver)); len = SvCUR(sv); @@ -599,6 +600,7 @@ VER_NV: len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver)); buf = tbuf; } + UNLOCK_NUMERIC_STANDARD(); RESTORE_NUMERIC_LOCAL(); while (buf[len-1] == '0' && len > 0) len--; if ( buf[len-1] == '.' ) len--; /* eat the trailing decimal */ |