summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2003-01-05 16:28:41 -0500
committerhv <hv@crypt.org>2003-02-10 00:26:50 +0000
commit129318bdc5341dc6c9c199fa27cbfe9b42b96328 (patch)
tree96243e4460b9ffaabdeede0bf28f992389fe9266 /universal.c
parentc9d8ec30e843d646cf43a9517acd0a6c4a17a510 (diff)
downloadperl-129318bdc5341dc6c9c199fa27cbfe9b42b96328.tar.gz
version objects final(?) patch
Message-ID: <3E18E9D9.2040908@rowman.com> p4raw-id: //depot/perl@18682
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/universal.c b/universal.c
index 3e8d8b113b..a198fe6c8e 100644
--- a/universal.c
+++ b/universal.c
@@ -352,17 +352,19 @@ XS(XS_UNIVERSAL_VERSION)
XS(XS_version_new)
{
dXSARGS;
- if (items != 2)
+ if (items > 3)
Perl_croak(aTHX_ "Usage: version::new(class, version)");
SP -= items;
{
/* char * class = (char *)SvPV_nolen(ST(0)); */
- SV * version = ST(1);
-
-{
- PUSHs(new_version(version));
-}
+ SV *version = ST(1);
+ if (items == 3 )
+ {
+ char *vs = savepvn(SvPVX(ST(2)),SvCUR(ST(2)));
+ version = newSVpvf("v%s",vs);
+ }
+ PUSHs(new_version(version));
PUTBACK;
return;
}