summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-01-09 17:42:43 -0600
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-01-10 10:51:16 +0000
commit6136c704e4e88f5381eda30a0d872d75aa9b9d11 (patch)
treed55b3c3db1fb6e481c40ca5c792663ec29bd75e7 /mg.c
parentb77de8c7a7a97830b8f0702cd830d615db2a1523 (diff)
downloadperl-6136c704e4e88f5381eda30a0d872d75aa9b9d11.tar.gz
It's the Barbie bus patch
Message-ID: <20060110054243.GA26165@petdance.com> p4raw-id: //depot/perl@26764
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mg.c b/mg.c
index d6e76676e9..3e3ebfd3c5 100644
--- a/mg.c
+++ b/mg.c
@@ -643,7 +643,8 @@ Perl_magic_len(pTHX_ SV *sv, MAGIC *mg)
#define SvRTRIM(sv) STMT_START { \
STRLEN len = SvCUR(sv); \
- while (len > 0 && isSPACE(SvPVX(sv)[len-1])) \
+ char * const p = SvPVX(sv); \
+ while (len > 0 && isSPACE(p[len-1])) \
--len; \
SvCUR_set(sv, len); \
} STMT_END
@@ -1257,7 +1258,7 @@ Perl_magic_clearsig(pTHX_ SV *sv, MAGIC *mg)
PL_psig_name[i]=0;
}
if(PL_psig_ptr[i]) {
- SV *to_dec=PL_psig_ptr[i];
+ SV * const to_dec=PL_psig_ptr[i];
PL_psig_ptr[i]=0;
LEAVE;
SvREFCNT_dec(to_dec);
@@ -1964,12 +1965,11 @@ Perl_magic_getvec(pTHX_ SV *sv, MAGIC *mg)
SV * const lsv = LvTARG(sv);
PERL_UNUSED_ARG(mg);
- if (!lsv) {
+ if (lsv)
+ sv_setuv(sv, do_vecget(lsv, LvTARGOFF(sv), LvTARGLEN(sv)));
+ else
SvOK_off(sv);
- return 0;
- }
- sv_setuv(sv, do_vecget(lsv, LvTARGOFF(sv), LvTARGLEN(sv)));
return 0;
}