summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-05 09:29:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-05 09:29:55 (GMT)
commit4d25168772b31a4966cb76f931eda3fbff01202b (patch)
treeb9f41bca824c8cdeb66e9e7897c772412c359106 /generic/tclCmdAH.c
parentd17af2c7031e75fe6db40f547797f26eaa08af13 (diff)
downloadtcl-4d25168772b31a4966cb76f931eda3fbff01202b.zip
tcl-4d25168772b31a4966cb76f931eda3fbff01202b.tar.gz
tcl-4d25168772b31a4966cb76f931eda3fbff01202b.tar.bz2
Fix [4718b41c56d8c135]: windows x86 & x64: file mtime overflows in modification date.
Only fixed for x64, because for x86 it isn't possible without breaking API compatibility.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 5484002..259b8cd 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -908,7 +908,7 @@ Tcl_FileObjCmd(
}
}
- Tcl_SetObjResult(interp, Tcl_NewLongObj((long)
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
(index == FCMD_ATIME ? buf.st_atime : buf.st_mtime)));
return TCL_OK;
case FCMD_ATTRIBUTES:
@@ -1527,9 +1527,9 @@ StoreStatData(
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
STORE_ARY("blksize", Tcl_NewLongObj((long)statPtr->st_blksize));
#endif
- STORE_ARY("atime", Tcl_NewLongObj((long)statPtr->st_atime));
- STORE_ARY("mtime", Tcl_NewLongObj((long)statPtr->st_mtime));
- STORE_ARY("ctime", Tcl_NewLongObj((long)statPtr->st_ctime));
+ STORE_ARY("atime", Tcl_NewWideIntObj(statPtr->st_atime));
+ STORE_ARY("mtime", Tcl_NewWideIntObj(statPtr->st_mtime));
+ STORE_ARY("ctime", Tcl_NewWideIntObj(statPtr->st_ctime));
mode = (unsigned short) statPtr->st_mode;
STORE_ARY("mode", Tcl_NewIntObj(mode));
STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1));