summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/util.c b/util.c
index b59959c6dc..18d3ed3c19 100644
--- a/util.c
+++ b/util.c
@@ -4814,21 +4814,28 @@ the original version contained 1 or more dots, respectively
SV *
Perl_vstringify(pTHX_ SV *vs)
{
- SV *pv;
-
PERL_ARGS_ASSERT_VSTRINGIFY;
if ( SvROK(vs) )
vs = SvRV(vs);
-
+
if ( !vverify(vs) )
Perl_croak(aTHX_ "Invalid version object");
- pv = *hv_fetchs((HV*)vs, "original", FALSE);
- if ( SvPOK(pv) )
- return newSVsv(pv);
- else
- return &PL_sv_undef;
+ if (hv_exists((HV*)vs, "original", sizeof("original") - 1)) {
+ SV *pv;
+ pv = *hv_fetchs((HV*)vs, "original", FALSE);
+ if ( SvPOK(pv) )
+ return newSVsv(pv);
+ else
+ return &PL_sv_undef;
+ }
+ else {
+ if ( hv_exists((HV *)vs, "qv", 2) )
+ return vnormal(vs);
+ else
+ return vnumify(vs);
+ }
}
/*