From: ceriel Date: Wed, 2 Sep 1987 12:43:23 +0000 (+0000) Subject: yet another fix in freopen: re-opening for reading did not work properly X-Git-Tag: release-5-5~3853 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c93f6d9fb1dc52dbdeddc0c7b93167a8cc406a54;p=ack.git yet another fix in freopen: re-opening for reading did not work properly --- 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);