From c93f6d9fb1dc52dbdeddc0c7b93167a8cc406a54 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 2 Sep 1987 12:43:23 +0000 Subject: [PATCH] yet another fix in freopen: re-opening for reading did not work properly --- lang/cem/libcc/stdio/freopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cem/libcc/stdio/freopen.c b/lang/cem/libcc/stdio/freopen.c index c217212c1..5711a2998 100644 --- a/lang/cem/libcc/stdio/freopen.c +++ b/lang/cem/libcc/stdio/freopen.c @@ -51,7 +51,7 @@ register FILE *fp; return NULL; } fp->_count = 0; - if (fp->_buf) fp->_count = BUFSIZ; + if (fp->_buf && (flags | IO_WRITEMODE)) fp->_count = BUFSIZ; fp->_fd = fd; fp->_flags = flags; return(fp); -- 2.34.1