mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
Fix mg_fs_posix.st() for Windows symlinks using ftell
This commit is contained in:
1 parent
24e3514640
commit
4a1f2e0dd3
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1062,7 +1062,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
|||||||
FILE *fp = _wfopen(tmp, L"rb");
|
FILE *fp = _wfopen(tmp, L"rb");
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
fseek(fp, 0, SEEK_END);
|
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);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
|||||||
FILE *fp = _wfopen(tmp, L"rb");
|
FILE *fp = _wfopen(tmp, L"rb");
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
fseek(fp, 0, SEEK_END);
|
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);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user