windows: PHYSFS_FILETYPE_OTHER files now report real filesize in PHYSFS_stat().
authorRyan C. Gordon <icculus@icculus.org>
Sun, 06 Aug 2017 09:25:05 -0400
changeset 1539 e965964f054a
parent 1538 81c73124d651
child 1540 7ee52240b696
windows: PHYSFS_FILETYPE_OTHER files now report real filesize in PHYSFS_stat(). I don't know if it's _meaningful_, but if the OS reports it, so do we.
src/physfs_platform_windows.c
--- a/src/physfs_platform_windows.c	Sun Aug 06 09:21:38 2017 -0400
+++ b/src/physfs_platform_windows.c	Sun Aug 06 09:25:05 2017 -0400
@@ -997,8 +997,7 @@
     else if (winstat.dwFileAttributes & (FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_DEVICE))
     {
         st->filetype = PHYSFS_FILETYPE_OTHER;
-        /* !!! FIXME: don't rely on this */
-        st->filesize = 0;
+        st->filesize = (((PHYSFS_uint64) winstat.nFileSizeHigh) << 32) | winstat.nFileSizeLow;
     } /* else if */
 
     else