diff options
author | Andy Lester <andy@petdance.com> | 2006-01-09 17:42:43 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-01-10 10:51:16 +0000 |
commit | 6136c704e4e88f5381eda30a0d872d75aa9b9d11 (patch) | |
tree | d55b3c3db1fb6e481c40ca5c792663ec29bd75e7 /pp_sys.c | |
parent | b77de8c7a7a97830b8f0702cd830d615db2a1523 (diff) | |
download | perl-6136c704e4e88f5381eda30a0d872d75aa9b9d11.tar.gz |
It's the Barbie bus patch
Message-ID: <20060110054243.GA26165@petdance.com>
p4raw-id: //depot/perl@26764
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 44 |
1 files changed, 23 insertions, 21 deletions
@@ -1932,8 +1932,6 @@ PP(pp_eof) { dVAR; dSP; GV *gv; - IO *io; - MAGIC *mg; if (MAXARG == 0) { if (PL_op->op_flags & OPf_SPECIAL) { /* eof() */ @@ -1958,17 +1956,19 @@ PP(pp_eof) else gv = PL_last_in_gv = (GV*)POPs; /* eof(FH) */ - if (gv && (io = GvIO(gv)) - && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar))) - { - PUSHMARK(SP); - XPUSHs(SvTIED_obj((SV*)io, mg)); - PUTBACK; - ENTER; - call_method("EOF", G_SCALAR); - LEAVE; - SPAGAIN; - RETURN; + if (gv) { + IO * const io = GvIO(gv); + MAGIC * mg; + if (io && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar))) { + PUSHMARK(SP); + XPUSHs(SvTIED_obj((SV*)io, mg)); + PUTBACK; + ENTER; + call_method("EOF", G_SCALAR); + LEAVE; + SPAGAIN; + RETURN; + } } PUSHs(boolSV(!gv || do_eof(gv))); @@ -3543,7 +3543,7 @@ S_dooneliner(pTHX_ const char *cmd, const char *filename) ; e++) { /* you don't see this */ - char *errmsg = + const char * const errmsg = #ifdef HAS_SYS_ERRLIST sys_errlist[e] #else @@ -5194,18 +5194,16 @@ PP(pp_ggrent) { #ifdef HAS_GROUP dVAR; dSP; - I32 which = PL_op->op_type; - register char **elem; - register SV *sv; - struct group *grent; + const I32 which = PL_op->op_type; + const struct group *grent; if (which == OP_GGRNAM) { const char* const name = POPpbytex; - grent = (struct group *)getgrnam(name); + grent = (const struct group *)getgrnam(name); } else if (which == OP_GGRGID) { const Gid_t gid = POPi; - grent = (struct group *)getgrgid(gid); + grent = (const struct group *)getgrgid(gid); } else #ifdef HAS_GETGRENT @@ -5216,7 +5214,9 @@ PP(pp_ggrent) EXTEND(SP, 4); if (GIMME != G_ARRAY) { - PUSHs(sv = sv_newmortal()); + SV * const sv = sv_newmortal(); + + PUSHs(sv); if (grent) { if (which == OP_GGRNAM) sv_setiv(sv, (IV)grent->gr_gid); @@ -5227,6 +5227,8 @@ PP(pp_ggrent) } if (grent) { + SV *sv; + char **elem; PUSHs(sv = sv_mortalcopy(&PL_sv_no)); sv_setpv(sv, grent->gr_name); |