X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=functions%2Fstdio%2Ffopen.c;h=9a01fe3debc8f225a5bdd1244ba85814355589f1;hb=8141cf89fa4483a17eda32d2d3239fcd02eda9b0;hp=1e9bd41358a60aa48484325bf9afe7333a4663e9;hpb=1b60fe07fc022bf1a4eb47153d535c58a3e31d19;p=fw%2Fpdclib diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 1e9bd41..9a01fe3 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -77,13 +77,12 @@ struct _PDCLIB_file_t * fopen( const char * _PDCLIB_restrict filename, const cha if ( ( rc->status = filemode( mode ) ) == 0 ) goto fail; /* invalid mode */ rc->handle = _PDCLIB_open( filename, rc->status ); if ( rc->handle == _PDCLIB_NOHANDLE ) goto fail; /* OS open() failed */ - /* Adding to list of open files */ rc->next = _PDCLIB_filelist; _PDCLIB_filelist = rc; /* Setting buffer, and mark as internal. TODO: Check for unbuffered? */ if ( ( rc->buffer = malloc( BUFSIZ ) ) == NULL ) goto fail; - rc->status |= _PDCLIB_LIBBUFFER; + rc->status |= ( _PDCLIB_LIBBUFFER | _PDCLIB_VIRGINSTR ); /* TODO: Setting mbstate */ return rc; fail: