Localizing vars
authorAndy Lester <andy@petdance.com>
Wed, 19 Apr 2006 23:44:01 +0000 (18:44 -0500)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 20 Apr 2006 09:04:46 +0000 (09:04 +0000)
Message-ID: <20060420044401.GA2792@petdance.com>

p4raw-id: //depot/perl@27908

util.c

diff --git a/util.c b/util.c
index 285b8b8..02c9e2e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3427,15 +3427,6 @@ Perl_my_fflush_all(pTHX)
 void
 Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
 {
-    const char * const func =
-       op == OP_READLINE   ? "readline"  :     /* "<HANDLE>" not nice */
-       op == OP_LEAVEWRITE ? "write" :         /* "write exit" not nice */
-       op < 0              ? "" :              /* handle phoney cases */
-       PL_op_desc[op];
-    const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
-    const char * const type = OP_IS_SOCKET(op)
-           || (gv && io && IoTYPE(io) == IoTYPE_SOCKET)
-               ?  "socket" : "filehandle";
     const char * const name = gv && isGV(gv) ? GvENAME(gv) : NULL;
 
     if (op == OP_phoney_OUTPUT_ONLY || op == OP_phoney_INPUT_ONLY) {
@@ -3464,6 +3455,15 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
        }
 
        if (ckWARN(warn_type)) {
+           const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
+           const char * const func =
+               op == OP_READLINE   ? "readline"  :     /* "<HANDLE>" not nice */
+               op == OP_LEAVEWRITE ? "write" :         /* "write exit" not nice */
+               op < 0              ? "" :              /* handle phoney cases */
+               PL_op_desc[op];
+           const char * const type = OP_IS_SOCKET(op)
+                   || (gv && io && IoTYPE(io) == IoTYPE_SOCKET)
+                       ?  "socket" : "filehandle";
            if (name && *name) {
                Perl_warner(aTHX_ packWARN(warn_type),
                            "%s%s on %s %s %s", func, pars, vile, type, name);