diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-07 17:29:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-07 17:29:51 +0000 |
commit | 66fc2fa5676803b0e5885abb1e459372b83f3321 (patch) | |
tree | 77bb787e58bb88c6bc0915188d292a56c5e1f383 /util.c | |
parent | 8615cb4363bc7ad267b2ee5e09e3bc20c0666d93 (diff) | |
download | perl-66fc2fa5676803b0e5885abb1e459372b83f3321.tar.gz |
Tiny tidying on report_evil_fh().
p4raw-id: //depot/perl@6541
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -3893,20 +3893,14 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) char *vile; I32 warn; char *func = - op == OP_READLINE ? "readline" : - op == OP_LEAVEWRITE ? "write" : + op == OP_READLINE ? "readline" : /* "<HANDLE>" not nice */ + op == OP_LEAVEWRITE ? "write" : /* "write exit" not nice */ PL_op_desc[op]; char *pars = OP_IS_FILETEST(op) ? "" : "()"; char *type = OP_IS_SOCKET(op) || (io && IoTYPE(io) == IoTYPE_SOCKET) ? "socket" : "filehandle"; char *name = NULL; - if (isGV(gv)) { - SV *sv = sv_newmortal(); - gv_efullname4(sv, gv, Nullch, FALSE); - name = SvPVX(sv); - } - if (io && IoTYPE(io) == IoTYPE_CLOSED) { vile = "closed"; warn = WARN_CLOSED; @@ -3916,6 +3910,12 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) warn = WARN_UNOPENED; } + if (gv && isGV(gv)) { + SV *sv = sv_newmortal(); + gv_efullname4(sv, gv, Nullch, FALSE); + name = SvPVX(sv); + } + if (name && *name) { Perl_warner(aTHX_ warn, "%s%s on %s %s %s", func, pars, vile, type, name); |