From: Jarkko Hietaniemi Date: Mon, 7 Aug 2000 17:29:51 +0000 (+0000) Subject: Tiny tidying on report_evil_fh(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66fc2fa5676803b0e5885abb1e459372b83f3321;p=p5sagit%2Fp5-mst-13.2.git Tiny tidying on report_evil_fh(). p4raw-id: //depot/perl@6541 --- diff --git a/util.c b/util.c index 4f18594..b2fc797 100644 --- a/util.c +++ b/util.c @@ -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" : /* "" 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);