This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
regen/mph.pl - Clean up diagnostics logic, allow DEBUG from env.
[perl5.git]
/
vutil.c
diff --git
a/vutil.c
b/vutil.c
index
2367489
..
ab05c33
100644
(file)
--- a/
vutil.c
+++ b/
vutil.c
@@
-533,7
+533,7
@@
Perl_new_version(pTHX_ SV *ver)
under = ninstr(raw, raw+len, underscore, underscore + 1);
if (under) {
Move(under + 1, under, raw + len - under - 1, char);
under = ninstr(raw, raw+len, underscore, underscore + 1);
if (under) {
Move(under + 1, under, raw + len - under - 1, char);
- SvCUR
(rv)--
;
+ SvCUR
_set(rv, SvCUR(rv) - 1)
;
*SvEND(rv) = '\0';
}
/* this is for consistency with the pure Perl class */
*SvEND(rv) = '\0';
}
/* this is for consistency with the pure Perl class */
@@
-571,11
+571,6
@@
Perl_upg_version2(pTHX_ SV *ver, bool qv)
Perl_upg_version(pTHX_ SV *ver, bool qv)
#endif
{
Perl_upg_version(pTHX_ SV *ver, bool qv)
#endif
{
-
-#ifdef dVAR
- dVAR;
-#endif
-
const char *version, *s;
#ifdef SvVOK
const MAGIC *mg;
const char *version, *s;
#ifdef SvVOK
const MAGIC *mg;
@@
-643,6
+638,8
@@
VER_NV:
if ( strNE(locale_name_on_entry, "C")
&& strNE(locale_name_on_entry, "POSIX"))
{
if ( strNE(locale_name_on_entry, "C")
&& strNE(locale_name_on_entry, "POSIX"))
{
+ /* the setlocale() call might free or overwrite the name */
+ locale_name_on_entry = savepv(locale_name_on_entry);
setlocale(LC_NUMERIC, "C");
}
else { /* This value indicates to the restore code that we didn't
setlocale(LC_NUMERIC, "C");
}
else { /* This value indicates to the restore code that we didn't
@@
-666,6
+663,8
@@
VER_NV:
if ( strNE(locale_name_on_entry, "C")
&& strNE(locale_name_on_entry, "POSIX"))
{
if ( strNE(locale_name_on_entry, "C")
&& strNE(locale_name_on_entry, "POSIX"))
{
+ /* the setlocale() call might free or overwrite the name */
+ locale_name_on_entry = savepv(locale_name_on_entry);
setlocale(LC_NUMERIC, "C");
}
else { /* This value indicates to the restore code that we
setlocale(LC_NUMERIC, "C");
}
else { /* This value indicates to the restore code that we
@@
-698,7
+697,7
@@
VER_NV:
#endif
if (sv) {
#endif
if (sv) {
- Perl_sv_
ca
tpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver));
+ Perl_sv_
se
tpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver));
len = SvCUR(sv);
buf = SvPVX(sv);
}
len = SvCUR(sv);
buf = SvPVX(sv);
}
@@
-715,6
+714,7
@@
VER_NV:
if (locale_name_on_entry) {
setlocale(LC_NUMERIC, locale_name_on_entry);
if (locale_name_on_entry) {
setlocale(LC_NUMERIC, locale_name_on_entry);
+ Safefree(locale_name_on_entry);
}
LC_NUMERIC_UNLOCK; /* End critical section */
}
LC_NUMERIC_UNLOCK; /* End critical section */
@@
-723,6
+723,7
@@
VER_NV:
if (locale_name_on_entry) {
setlocale(LC_NUMERIC, locale_name_on_entry);
if (locale_name_on_entry) {
setlocale(LC_NUMERIC, locale_name_on_entry);
+ Safefree(locale_name_on_entry);
LC_NUMERIC_UNLOCK;
}
else if (locale_obj_on_entry == PL_underlying_numeric_obj) {
LC_NUMERIC_UNLOCK;
}
else if (locale_obj_on_entry == PL_underlying_numeric_obj) {
@@
-758,7
+759,6
@@
VER_PV:
version = savepvn(SvPV(ver,len), SvCUR(ver));
SAVEFREEPV(version);
#ifndef SvVOK
version = savepvn(SvPV(ver,len), SvCUR(ver));
SAVEFREEPV(version);
#ifndef SvVOK
-# if PERL_VERSION > 5
/* This will only be executed for 5.6.0 - 5.8.0 inclusive */
if ( len >= 3 && !instr(version,".") && !instr(version,"_")) {
/* may be a v-string */
/* This will only be executed for 5.6.0 - 5.8.0 inclusive */
if ( len >= 3 && !instr(version,".") && !instr(version,"_")) {
/* may be a v-string */
@@
-791,7
+791,6
@@
VER_PV:
}
}
}
}
}
}
-# endif
#endif
}
#if PERL_VERSION_LT(5,17,2)
#endif
}
#if PERL_VERSION_LT(5,17,2)