Fix mg_fs_posix.st() for Windows symlinks using ftell

This commit is contained in:
cpq committed 2023-02-17 10:36:06 +00:00
1 parent 24e3514640
commit 4a1f2e0dd3
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1062,7 +1062,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
FILE *fp = _wfopen(tmp, L"rb");
if (fp != NULL) {
fseek(fp, 0, SEEK_END);
if (_ftelli64(fp) > 0) st.st_size = _ftelli64(fp);
if (ftell(fp) > 0) st.st_size = ftell(fp); // Use _ftelli64 on win10+
fclose(fp);
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
FILE *fp = _wfopen(tmp, L"rb");
if (fp != NULL) {
fseek(fp, 0, SEEK_END);
if (_ftelli64(fp) > 0) st.st_size = _ftelli64(fp);
if (ftell(fp) > 0) st.st_size = ftell(fp); // Use _ftelli64 on win10+
fclose(fp);
}
}