From e791247d9a2070567bfa2c591388133a5323f2a0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 19 Jan 2021 13:10:34 +0100 Subject: [PATCH] Fix regression causing failure if argument is a file larger than 4GiB --- DirHash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DirHash.cpp b/DirHash.cpp index b6d7adf..31b7dee 100644 --- a/DirHash.cpp +++ b/DirHash.cpp @@ -2174,7 +2174,7 @@ BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) bool GetPathType(LPCWSTR szPath, bool& bIsFile) { - struct _stat buf; + struct _stat64 buf; std::wstring drivePath; bIsFile = false; if (wcslen(szPath) == 2 && szPath[1] == L':') @@ -2183,7 +2183,7 @@ bool GetPathType(LPCWSTR szPath, bool& bIsFile) drivePath += L"\\"; szPath = drivePath.c_str(); } - if ((0 == _wstat(szPath, &buf)) && (buf.st_mode & (_S_IFDIR | _S_IFREG))) + if ((0 == _wstat64(szPath, &buf)) && (buf.st_mode & (_S_IFDIR | _S_IFREG))) { bIsFile = (buf.st_mode & _S_IFREG)? true : false; return true;