yet another fix in freopen: re-opening for reading did not work properly
authorceriel <none@none>
Wed, 2 Sep 1987 12:43:23 +0000 (12:43 +0000)
committerceriel <none@none>
Wed, 2 Sep 1987 12:43:23 +0000 (12:43 +0000)
lang/cem/libcc/stdio/freopen.c

index c217212..5711a29 100644 (file)
@@ -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);