X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xsutils.c;h=b4161b0d09627bd03307c2d2925c558b37b411b8;hb=6f9d8c32c6a78a47c6088f50d7051d779f712ee1;hp=f9d5e0d28bb6fe4ae62beaace26b21fd72895148;hpb=146174a91a192983720a158796dc066226ad0e55;p=p5sagit%2Fp5-mst-13.2.git diff --git a/xsutils.c b/xsutils.c index f9d5e0d..b4161b0 100644 --- a/xsutils.c +++ b/xsutils.c @@ -23,7 +23,7 @@ void XS_attributes_bootstrap(pTHXo_ CV *cv); * * The various bootstrap definitions can take care of doing * package-specific newXS() calls. Since the layout of the - * bundled lib/*.pm files is in a version-specific directory, + * bundled *.pm files is in a version-specific directory, * version checks in these bootstrap calls are optional. */ @@ -48,7 +48,7 @@ modify_SV_attributes(pTHXo_ SV *sv, SV **retlist, SV **attrlist, int numattrs) for (nret = 0 ; numattrs && (attr = *attrlist++); numattrs--) { name = SvPV(attr, len); - if (negated = (*name == '-')) { + if ((negated = (*name == '-'))) { name++; len--; } @@ -253,11 +253,9 @@ usage: rv = ST(0); ST(0) = TARG; - if (!SvOK(rv)) { - ST(0) = &PL_sv_no; - XSRETURN(1); - } - if (!SvROK(rv)) + if (SvGMAGICAL(rv)) + mg_get(rv); + if (!(SvOK(rv) && SvROK(rv))) goto usage; sv = SvRV(rv); sv_setpv(TARG, sv_reftype(sv, 0)); @@ -271,7 +269,6 @@ usage: XS(XS_attributes__warn_reserved) { dXSARGS; - SV *rv, *sv; #ifdef dXSTARGET dXSTARGET; #else