diff --git a/src/os_win/file.c b/src/os_win/file.c index b40989c..6756c7b 100644 --- a/src/os_win/file.c +++ b/src/os_win/file.c @@ -275,6 +275,7 @@ FILE *freopen(const char *restrict name, const char *restrict mode, FILE *restri DWORD share = win_mode.share; DWORD disp = win_mode.disp; if(name == NULL) { + // This codepath doesn't work HANDLE handle = ReOpenFile(stream->handle, access, share, flags); if(handle == INVALID_HANDLE_VALUE) { return NULL; diff --git a/test/crt.c b/test/crt.c index 458a9e0..f5d2edd 100644 --- a/test/crt.c +++ b/test/crt.c @@ -647,7 +647,7 @@ int main(int argc, char **argv) { TEST(fputs(str, file) >= 0, "fputs failed"); TEST(fputc('!', file) == '!', "fputc failed"); TEST(fflush(file) == 0, "fflush failed"); - TEST(fclose(file) == 0, "fclose failed"); + // TEST(fclose(file) == 0, "fclose failed"); file = freopen("test_folder/getc", "rb", file); TEST(file != NULL, "Reopened file is NULL"); TEST(fgets(str, sizeof str, file) == str, "fgets failed");