int
Perl_magic_clearenv(pTHX_ SV *sv, MAGIC *mg)
{
- STRLEN n_a;
(void)sv;
- my_setenv(MgPV(mg,n_a),Nullch);
+ my_setenv(MgPV_nolen_const(mg),Nullch);
return 0;
}
Perl_magic_getsig(pTHX_ SV *sv, MAGIC *mg)
{
I32 i;
- STRLEN n_a;
/* Are we fetching a signal entry? */
- i = whichsig(MgPV(mg,n_a));
+ i = whichsig(MgPV_nolen_const(mg));
if (i > 0) {
if(PL_psig_ptr[i])
sv_setsv(sv,PL_psig_ptr[i]);
* refactoring might be in order.
*/
dVAR;
- STRLEN n_a;
- register const char *s = MgPV(mg,n_a);
+ register const char *s = MgPV_nolen_const(mg);
(void)sv;
if (*s == '_') {
SV** svp = 0;
I32 i;
GV* gv;
SV** svp;
- STRLEN n_a;
gv = PL_DBline;
i = SvTRUE(sv);
svp = av_fetch(GvAV(gv),
- atoi(MgPV(mg,n_a)), FALSE);
+ atoi(MgPV_nolen_const(mg)), FALSE);
if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp)))) {
/* set or clear breakpoint in the relevant control op */
if (i)
#define MgPV(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \
SvPV((SV*)((mg)->mg_ptr),lp) : \
(mg)->mg_ptr)
-#define MgPV_const(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \
- SvPV_const((SV*)((mg)->mg_ptr),lp) : \
+#define MgPV_const(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \
+ SvPV_const((SV*)((mg)->mg_ptr),lp) : \
+ (const char*)(mg)->mg_ptr)
+#define MgPV_nolen_const(mg) (((((int)(mg)->mg_len)) == HEf_SVKEY) ? \
+ SvPV_nolen_const((SV*)((mg)->mg_ptr)) : \
(const char*)(mg)->mg_ptr)
#define SvTIED_mg(sv,how) \