summaryrefslogtreecommitdiffstats
path: root/win/tclWinTime.c
diff options
context:
space:
mode:
authordavygrvy@pobox.com <davygrvy>2003-12-16 02:55:38 (GMT)
committerdavygrvy@pobox.com <davygrvy>2003-12-16 02:55:38 (GMT)
commit13070e4fc3def4b955d6e29a017974a8cf347d3c (patch)
treeac8c841e1470bf5440f5c63c7ab2e4f25b5b2821 /win/tclWinTime.c
parent5ca4f9fabf80b06b92364efbd3b896af87444f27 (diff)
downloadtcl-13070e4fc3def4b955d6e29a017974a8cf347d3c.zip
tcl-13070e4fc3def4b955d6e29a017974a8cf347d3c.tar.gz
tcl-13070e4fc3def4b955d6e29a017974a8cf347d3c.tar.bz2
* win/tclWinFile.c (TclpUtime) : utimbuf struct not a problem
with Borland. * win/tclWinTime.c (TclpGetDate) : Borland's localtime() has a slight behavioral difference. From Helmut Giese <hgiese@ratiosoft.com> [Patch 758097].
Diffstat (limited to 'win/tclWinTime.c')
-rw-r--r--win/tclWinTime.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/win/tclWinTime.c b/win/tclWinTime.c
index 39057cd..396adfa 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinTime.c,v 1.20 2003/08/27 19:50:07 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinTime.c,v 1.21 2003/12/16 02:55:38 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -561,7 +561,20 @@ TclpGetDate(t, useGMT)
* algorithm ignores daylight savings time before the epoch.
*/
+ /*
+ Hm, Borland's localtime manages to return NULL under certain
+ circumstances (e.g. wintime.test, test 1.2). Nobody tests for this,
+ since 'localtime' isn't supposed to do this, possibly leading to
+ crashes.
+ Patch: We only call this function if we are at least one day into
+ the epoch, else we handle it ourselves (like we do for times < 0).
+ H. Giese, June 2003
+ */
+#ifdef __BORLANDC__
+ if (*tp >= SECSPERDAY) {
+#else
if (*tp >= 0) {
+#endif
return localtime(tp);
}