Tue May 02 23:45:48 2000 DJ Delorie <dj@cygnus.com>

* libc/include/stdio.h (FILE): define __SCLE for "convert line
        endings" for Cygwin.
        (__sgetc): convert line endings if needed
        (__sputc): ditto
        * libc/stdio/fdopen.c (_fdopen_r): Remember if we opened in text mode
        * libc/stdio/fopen.c (_fopen_r): ditto
        * libc/stdio/freopen.c (freopen): ditto
        * libc/stdio/fread.c (fread): perform CRLF conversions if __SCLE
        * libc/stdio/fvwrite.c (__sfvwrite): ditto
This commit is contained in:
Jeff Johnston
2000-05-03 03:57:19 +00:00
parent a939e045e7
commit 49d64538cd
7 changed files with 143 additions and 2 deletions

View File

@ -147,5 +147,11 @@ _DEFUN (freopen, (file, mode, fp),
fp->_write = __swrite;
fp->_seek = __sseek;
fp->_close = __sclose;
#ifdef __SCLE
if (setmode(fp->_file, O_BINARY) == O_TEXT)
fp->_flags |= __SCLE;
#endif
return fp;
}