summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-05-29 00:19:39 (GMT)
committerhobbs <hobbs>2002-05-29 00:19:39 (GMT)
commitacc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf (patch)
tree29125ebe484614a6acad3335d784da4ad422b93a /generic
parent255468e31d6c18b6e10f63c0d914101824c2ce7f (diff)
downloadtcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.zip
tcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.tar.gz
tcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.tar.bz2
* tests/clock.test: added clock-9.1
* compat/strftime.c: * generic/tclClock.c: * generic/tclInt.decls: * generic/tclIntDecls.h: * unix/tclUnixTime.c: fix for Windows msvcrt mem leak caused by using an env(TZ) setting trick for in clock format -gmt 1. This also makes %s seem to work correctly with -gmt 1 as well as making it a lot faster by avoid the env(TZ) hack. TclpStrftime now takes useGMT as an arg. [Bug #559376]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclClock.c8
-rw-r--r--generic/tclInt.decls4
-rw-r--r--generic/tclIntDecls.h7
3 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 5cfc675..9bf7ed0 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclClock.c,v 1.14 2002/01/25 20:40:55 dgp Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.15 2002/05/29 00:19:40 hobbs Exp $
*/
#include "tcl.h"
@@ -289,7 +289,7 @@ FormatClock(interp, clockVal, useGMT, format)
return TCL_OK;
}
-#ifndef HAVE_TM_ZONE
+#if !defined(HAVE_TM_ZONE) && !defined(WIN32)
/*
* This is a kludge for systems not having the timezone string in
* struct tm. No matter what was specified, they use the local
@@ -332,10 +332,10 @@ FormatClock(interp, clockVal, useGMT, format)
Tcl_MutexLock(&clockMutex);
result = TclpStrftime(buffer.string, (unsigned int) bufSize, format,
- timeDataPtr);
+ timeDataPtr, useGMT);
Tcl_MutexUnlock(&clockMutex);
-#ifndef HAVE_TM_ZONE
+#if !defined(HAVE_TM_ZONE) && !defined(WIN32)
if (useGMT) {
if (savedTZEnv != NULL) {
Tcl_SetVar2(interp, "env", "TZ", savedTZEnv, TCL_GLOBAL_ONLY);
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 4b6523c..b4d07fa 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tclInt.decls,v 1.48 2002/04/19 14:18:33 das Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.49 2002/05/29 00:19:40 hobbs Exp $
library tcl
@@ -518,7 +518,7 @@ declare 133 generic {
}
declare 134 generic {
size_t TclpStrftime(char *s, size_t maxsize, CONST char *format,
- CONST struct tm *t)
+ CONST struct tm *t, int useGMT)
}
declare 135 generic {
int TclpCheckStackSpace(void)
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index dd2bd0f..a16cc73 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIntDecls.h,v 1.39 2002/03/20 22:47:36 dgp Exp $
+ * RCS: @(#) $Id: tclIntDecls.h,v 1.40 2002/05/29 00:19:40 hobbs Exp $
*/
#ifndef _TCLINTDECLS
@@ -420,7 +420,8 @@ EXTERN int TclpHasSockets _ANSI_ARGS_((Tcl_Interp * interp));
EXTERN struct tm * TclpGetDate _ANSI_ARGS_((TclpTime_t time, int useGMT));
/* 134 */
EXTERN size_t TclpStrftime _ANSI_ARGS_((char * s, size_t maxsize,
- CONST char * format, CONST struct tm * t));
+ CONST char * format, CONST struct tm * t,
+ int useGMT));
/* 135 */
EXTERN int TclpCheckStackSpace _ANSI_ARGS_((void));
/* Slot 136 is reserved */
@@ -673,7 +674,7 @@ typedef struct TclIntStubs {
void (*tcl_SetNamespaceResolvers) _ANSI_ARGS_((Tcl_Namespace * namespacePtr, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc)); /* 131 */
int (*tclpHasSockets) _ANSI_ARGS_((Tcl_Interp * interp)); /* 132 */
struct tm * (*tclpGetDate) _ANSI_ARGS_((TclpTime_t time, int useGMT)); /* 133 */
- size_t (*tclpStrftime) _ANSI_ARGS_((char * s, size_t maxsize, CONST char * format, CONST struct tm * t)); /* 134 */
+ size_t (*tclpStrftime) _ANSI_ARGS_((char * s, size_t maxsize, CONST char * format, CONST struct tm * t, int useGMT)); /* 134 */
int (*tclpCheckStackSpace) _ANSI_ARGS_((void)); /* 135 */
void *reserved136;
void *reserved137;