Skip to content

Commit

Permalink
FIX: query on directory was returning garbage size info.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed May 16, 2018
1 parent 1c737e1 commit 3b89ed9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/os/win32/dev-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,14 @@ static BOOL Seek_File_64(REBREQ *file)
return DR_ERROR;
}

if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) SET_FLAG(file->modes, RFM_DIR);
else CLR_FLAG(file->modes, RFM_DIR);
file->file.size = ((i64)info.nFileSizeHigh << 32) + (i64)info.nFileSizeLow;
if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
SET_FLAG(file->modes, RFM_DIR);
file->file.size = 0;
}
else {
CLR_FLAG(file->modes, RFM_DIR);
file->file.size = ((i64)info.nFileSizeHigh << 32) + (i64)info.nFileSizeLow;
}
file->file.time.l = info.ftLastWriteTime.dwLowDateTime;
file->file.time.h = info.ftLastWriteTime.dwHighDateTime;
return DR_DONE;
Expand Down

0 comments on commit 3b89ed9

Please sign in to comment.