This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
initialize undefined version objects with zero, not 'undef'
authorDavid Golden <dagolden@cpan.org>
Thu, 21 Jan 2010 17:18:11 +0000 (12:18 -0500)
committerDavid Golden <dagolden@cpan.org>
Thu, 21 Jan 2010 17:18:11 +0000 (12:18 -0500)
universal.c

index 5a2cddb..ce56d0b 100644 (file)
@@ -549,7 +549,7 @@ XS(XS_version_new)
        if ( items == 1 || ! SvOK(vs) ) { /* no param or explicit undef */
            /* create empty object */
            vs = sv_newmortal();
-           sv_setpvs(vs, "undef");
+           sv_setpvs(vs, "0");
        }
        else if ( items == 3 ) {
            vs = sv_newmortal();
@@ -659,7 +659,7 @@ XS(XS_version_vcmp)
 
               if ( ! sv_derived_from(robj, "version") )
               {
-                   robj = new_version(SvOK(robj) ? robj : newSVpvs("undef"));
+                   robj = new_version(SvOK(robj) ? robj : newSVpvs("0"));
               }
               rvs = SvRV(robj);