X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=util.c;h=52872a88563b83a2753db872132978ab8d131a4e;hb=33235a50d090f47e8c1345f546ef4a97abb985d9;hp=4ccd589ecd592eb1f827f52bfe86d9143d963cbe;hpb=b3c85772f7a16b79e679c78c9638a7afa4856432;p=p5sagit%2Fp5-mst-13.2.git diff --git a/util.c b/util.c index 4ccd589..52872a8 100644 --- 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;