mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +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");
|
||||
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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user