mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
Fix mg_fs_posix.st() for Windows symlinks using ftell
This commit is contained in:
parent
24e3514640
commit
4a1f2e0dd3
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user