From: Nicholas Clark Date: Tue, 14 Jun 2005 16:29:49 +0000 (+0000) Subject: Change 24838 breaks deparse.t, which checks that embedded NULs work. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b55685ae0907b7da1c668988d736c684531f41ac;p=p5sagit%2Fp5-mst-13.2.git Change 24838 breaks deparse.t, which checks that embedded NULs work. Here's a temporary hack, pending a way for B to correctly identify PVs that are variable names in pads. p4raw-id: //depot/perl@24843 --- diff --git a/ext/B/B.xs b/ext/B/B.xs index d317fb9..f9c8647 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1215,7 +1215,15 @@ SvPV(sv) CODE: ST(0) = sv_newmortal(); if( SvPOK(sv) ) { - sv_setpv(ST(0), SvPV_nolen_const(sv)); + /* FIXME - we need a better way for B to identify PVs that are + in the pads as variable names. */ + if((SvLEN(sv) && SvCUR(sv) >= SvLEN(sv))) { + /* It claims to be longer than the space allocated for it - + presuambly it's a variable name in the pad */ + sv_setpv(ST(0), SvPV_nolen_const(sv)); + } else { + sv_setpvn(ST(0), SvPVX_const(sv), SvCUR(sv)); + } SvFLAGS(ST(0)) |= SvUTF8(sv); } else {