Fix for "[ID 20000329.080] quad printing does not work as documented",
[p5sagit/p5-mst-13.2.git] / universal.c
index 28e0896..fc0ec41 100644 (file)
@@ -142,7 +142,7 @@ XS(XS_UNIVERSAL_isa)
     if (SvGMAGICAL(sv))
        mg_get(sv);
 
-    if (!SvOK(sv) || !(SvROK(sv) || SvCUR(sv)))
+    if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))))
        XSRETURN_UNDEF;
 
     name = (char *)SvPV(ST(1),n_a);
@@ -168,7 +168,7 @@ XS(XS_UNIVERSAL_can)
     if (SvGMAGICAL(sv))
        mg_get(sv);
 
-    if (!SvOK(sv) || !(SvROK(sv) || SvCUR(sv)))
+    if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))))
        XSRETURN_UNDEF;
 
     name = (char *)SvPV(ST(1),n_a);
@@ -246,8 +246,8 @@ XS(XS_UNIVERSAL_VERSION)
                    /* they said C<use Foo v1.2.3> and $Foo::VERSION
                     * doesn't look like a float: do string compare */
                    if (sv_cmp(req,sv) == 1) {
-                       Perl_croak(aTHX_ "%s version v%vd required--"
-                                  "this is only version v%vd",
+                       Perl_croak(aTHX_ "%s v%vd required--"
+                                  "this is only v%vd",
                                   HvNAME(pkg), req, sv);
                    }
                    goto finish;