if (result == EOF && fd > PL_maxsysfd) {
/* Why is this not Perl_warn*() call ? */
PerlIO_printf(Perl_error_log,
- "Warning: unable to close filehandle %s properly.\n",
- GvENAME(gv));
+ "Warning: unable to close filehandle %"HEKf" properly.\n",
+ HEKfARG(GvENAME_HEK(gv))
+ );
}
IoOFP(io) = IoIFP(io) = NULL;
}
if ((IoTYPE(io) == IoTYPE_RDONLY) &&
(fp == PerlIO_stdout() || fp == PerlIO_stderr())) {
Perl_warner(aTHX_ packWARN(WARN_IO),
- "Filehandle STD%s reopened as %s only for input",
+ "Filehandle STD%s reopened as %"HEKf
+ " only for input",
((fp == PerlIO_stdout()) ? "OUT" : "ERR"),
- GvENAME(gv));
+ HEKfARG(GvENAME_HEK(gv)));
}
else if ((IoTYPE(io) == IoTYPE_WRONLY) && fp == PerlIO_stdin()) {
Perl_warner(aTHX_ packWARN(WARN_IO),
- "Filehandle STDIN reopened as %s only for output",
- GvENAME(gv));
+ "Filehandle STDIN reopened as %"HEKf" only for output",
+ HEKfARG(GvENAME_HEK(gv))
+ );
}
}
return PL_laststatval;
}
if (ckWARN(WARN_IO)) {
- Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
- GvENAME(cGVOP_gv));
+ Perl_warner(aTHX_ packWARN(WARN_IO),
+ "Use of -l on filehandle %"HEKf,
+ HEKfARG(GvENAME_HEK(cGVOP_gv)));
}
return (PL_laststatval = -1);
}
- else if (PL_laststype != OP_LSTAT
- && (PL_op->op_private & OPpFT_STACKED) && ckWARN(WARN_IO))
+ else if (PL_op->op_private & OPpFT_STACKED) {
+ if (PL_laststype != OP_LSTAT)
Perl_croak(aTHX_ no_prev_lstat);
+ return PL_laststatval;
+ }
PL_laststype = OP_LSTAT;
PL_statgv = NULL;
sv = POPs;
PUTBACK;
- if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) {
- Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
- GvENAME((const GV *)SvRV(sv)));
- return (PL_laststatval = -1);
- }
file = SvPV_flags_const_nolen(sv, flags);
sv_setpv(PL_statname,file);
PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
register I32 tot = 0;
const char *const what = PL_op_name[type];
const char *s;
+ STRLEN len;
SV ** const oldmark = mark;
PERL_ARGS_ASSERT_APPLY;
APPLY_TAINT_PROPER();
if (mark == sp)
break;
- s = SvPVx_nolen_const(*++mark);
+ s = SvPVx_const(*++mark, len);
if (isALPHA(*s)) {
- if (*s == 'S' && s[1] == 'I' && s[2] == 'G')
+ if (*s == 'S' && s[1] == 'I' && s[2] == 'G') {
s += 3;
- if ((val = whichsig(s)) < 0)
- Perl_croak(aTHX_ "Unrecognized signal name \"%s\"",s);
+ len -= 3;
+ }
+ if ((val = whichsig_pvn(s, len)) < 0)
+ Perl_croak(aTHX_ "Unrecognized signal name \"%"SVf"\"", SVfARG(*mark));
}
else
val = SvIV(*mark);
/* suppress warning when reading into undef var (tchrist 3/Mar/00) */
if (! SvOK(mstr))
sv_setpvs(mstr, "");
- SvPV_force_nolen(mstr);
+ SvUPGRADE(mstr, SVt_PV);
+ SvPOK_only(mstr);
mbuf = SvGROW(mstr, (STRLEN)msize+1);
Copy(shm + mpos, mbuf, msize, char);
#endif
#endif /* !CSH */
#endif /* !DOSISH */
+ {
+ GV * const envgv = gv_fetchpvs("ENV", 0, SVt_PVHV);
+ SV ** const home = hv_fetchs(GvHV(envgv), "HOME", 0);
+ if (home && *home) SvGETMAGIC(*home);
+ save_hash(gv_fetchpvs("ENV", 0, SVt_PVHV));
+ if (home && *home) SvSETMAGIC(*home);
+ }
(void)do_open(PL_last_in_gv, (char*)SvPVX_const(tmpcmd), SvCUR(tmpcmd),
FALSE, O_RDONLY, 0, NULL);
fp = IoIFP(io);