From d9e5430e5a7bd5d2de7c4fee2f1afbd52ec5aa2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 16 Jan 2012 11:45:34 +0100 Subject: [PATCH] Windows: store all 64 bits of the size in the stat structure We force stat to be a stat64 structure, so we can and should put all 64 bits of the size in st_size. --- src/win32/posix_w32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c index 00016542d..f68742fc0 100644 --- a/src/win32/posix_w32.c +++ b/src/win32/posix_w32.c @@ -80,7 +80,7 @@ static int do_lstat(const char *file_name, struct stat *buf) buf->st_uid = 0; buf->st_nlink = 1; buf->st_mode = (mode_t)fMode; - buf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */ + buf->st_size = (fdata.nFileSizeHigh << 32) + fdata.nFileSizeLow; buf->st_dev = buf->st_rdev = (_getdrive() - 1); buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime)); buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));