X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffopen.c;h=d181cc1f876ded1362cc297e8c2fad923e67ae64;hb=566bfcc6924abd9fccbd97fa8207711e899dd0bc;hp=e15338319ac07cf8ee3025fefda51be1da36ab7b;hpb=a5d6aa23d413d22e6eed9c9d813b063f70cddb16;p=pdclib diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index e153383..d181cc1 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -38,7 +38,11 @@ struct _PDCLIB_file_t * fopen( const char * _PDCLIB_restrict filename, const cha if ( ( rc->buffer = malloc( BUFSIZ ) ) == NULL ) goto fail; rc->bufsize = BUFSIZ; rc->bufidx = 0; - rc->status |= ( _PDCLIB_LIBBUFFER | _PDCLIB_VIRGINSTR ); + /* Setting buffer to _IOLBF because "when opened, a stream is fully + buffered if and only if it can be determined not to refer to an + interactive device." + */ + rc->status |= ( _PDCLIB_LIBBUFFER | _PDCLIB_VIRGINSTR /* | _IOLBF */ ); /* FIXME: Uncommenting the _IOLBF here breaks output. */ /* TODO: Setting mbstate */ return rc; fail: