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

@ -62,6 +62,27 @@ __sfvwrite (fp, uio)
iov = uio->uio_iov;
len = 0;
#ifdef __SCLE
if (fp->_flags & __SCLE) /* text mode */
{
do
{
GETIOV (;);
while (len > 0)
{
if (putc(*p, fp) == EOF)
return EOF;
p++;
len--;
uio->uio_resid--;
}
}
while (uio->uio_resid > 0);
return 0;
}
#endif
if (fp->_flags & __SNBF)
{
/*