Skip to content

Commit

Permalink
Fix regression causing failure if argument is a file larger than 4GiB
Browse files Browse the repository at this point in the history
  • Loading branch information
idrassi committed Jan 19, 2021
1 parent e6b11c0 commit e791247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DirHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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':')
Expand All @@ -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;
Expand Down

0 comments on commit e791247

Please sign in to comment.