more for Devel::SelfStubber
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index 4ccd589..52872a8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4040,11 +4040,12 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
        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) ?
+    char *type = OP_IS_SOCKET(op) ||
+                 (gv && io && IoTYPE(io) == IoTYPE_SOCKET) ?
                      "socket" : "filehandle";
     char *name = NULL;
 
-    if (io && IoTYPE(io) == IoTYPE_CLOSED) {
+    if (gv && io && IoTYPE(io) == IoTYPE_CLOSED) {
        vile = "closed";
        warn_type = WARN_CLOSED;
     }
@@ -4078,7 +4079,7 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
     else {
        Perl_warner(aTHX_ warn_type,
                    "%s%s on %s %s", func, pars, vile, type);
-       if (io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
+       if (gv && io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
            Perl_warner(aTHX_ warn_type,
                        "\t(Are you trying to call %s%s on dirhandle?)\n",
                        func, pars);
@@ -4125,16 +4126,6 @@ Perl_ebcdic_control(pTHX_ int ch)
 }
 #endif
 
-#ifdef HAS_TZNAME
-#  if !defined(WIN32) && !defined(__CYGWIN__)
-extern char *tzname[];
-#  endif
-#else
-#if !defined(WIN32) || (defined(__MINGW32__) && !defined(tzname))
-char *tzname[] = { "" , "" };
-#endif
-#endif
-
 /* XXX struct tm on some systems (SunOS4/BSD) contains extra (non POSIX)
  * fields for which we don't have Configure support yet:
  *   char *tm_zone;   -- abbreviation of timezone name
@@ -4156,7 +4147,7 @@ char *tzname[] = { "" , "" };
 #endif
 
 void
-init_tm(struct tm *ptm)                /* see mktime, strftime and asctime     */
+Perl_init_tm(pTHX_ struct tm *ptm)     /* see mktime, strftime and asctime */
 {
 #ifdef STRUCT_TM_HASZONE
     Time_t now;
@@ -4170,7 +4161,7 @@ init_tm(struct tm *ptm)           /* see mktime, strftime and asctime     */
  * semantics (and overhead) of mktime().
  */
 void
-mini_mktime(struct tm *ptm)
+Perl_mini_mktime(pTHX_ struct tm *ptm)
 {
     int yearday;
     int secs;
@@ -4363,7 +4354,7 @@ mini_mktime(struct tm *ptm)
 }
 
 char *
-my_strftime(char *fmt, int sec, int min, int hour, int mday, int mon, int year, int wday, int yday, int isdst)
+Perl_my_strftime(pTHX_ char *fmt, int sec, int min, int hour, int mday, int mon, int year, int wday, int yday, int isdst)
 {
 #ifdef HAS_STRFTIME
   char *buf;