mirror of https://github.com/flysand7/ciabatta.git
Account for 'shit aint working' kind of issue
This commit is contained in:
parent
2cad69beeb
commit
64191d2148
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue