* Various formatting and whitespace changes.
This commit is contained in:
@ -62,10 +62,10 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
|
||||
#ifdef __SCLE
|
||||
static size_t
|
||||
_DEFUN (crlf, (fp, buf, count, eof),
|
||||
FILE * fp _AND
|
||||
char * buf _AND
|
||||
size_t count _AND
|
||||
int eof)
|
||||
FILE * fp _AND
|
||||
char * buf _AND
|
||||
size_t count _AND
|
||||
int eof)
|
||||
{
|
||||
int newcount = 0, r;
|
||||
char *s, *d, *e;
|
||||
@ -77,19 +77,19 @@ _DEFUN (crlf, (fp, buf, count, eof),
|
||||
for (s=d=buf; s<e-1; s++)
|
||||
{
|
||||
if (*s == '\r' && s[1] == '\n')
|
||||
s++;
|
||||
s++;
|
||||
*d++ = *s;
|
||||
}
|
||||
if (s < e)
|
||||
{
|
||||
if (*s == '\r')
|
||||
{
|
||||
int c = __sgetc_raw(fp);
|
||||
if (c == '\n')
|
||||
*s = '\n';
|
||||
else
|
||||
ungetc(c, fp);
|
||||
}
|
||||
{
|
||||
int c = __sgetc_raw(fp);
|
||||
if (c == '\n')
|
||||
*s = '\n';
|
||||
else
|
||||
ungetc(c, fp);
|
||||
}
|
||||
*d++ = *s++;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ _DEFUN (crlf, (fp, buf, count, eof),
|
||||
{
|
||||
r = getc(fp);
|
||||
if (r == EOF)
|
||||
return count - (e-d);
|
||||
return count - (e-d);
|
||||
*d++ = r;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ _DEFUN (fread, (buf, size, count, fp),
|
||||
{
|
||||
/* no more input: return partial result */
|
||||
#ifdef __SCLE
|
||||
if (fp->_flags & __SCLE)
|
||||
if (fp->_flags & __SCLE)
|
||||
return crlf(fp, buf, total-resid, 1) / size;
|
||||
#endif
|
||||
return (total - resid) / size;
|
||||
|
@ -67,17 +67,17 @@ __sfvwrite (fp, uio)
|
||||
if (fp->_flags & __SCLE) /* text mode */
|
||||
{
|
||||
do
|
||||
{
|
||||
GETIOV (;);
|
||||
while (len > 0)
|
||||
{
|
||||
if (putc(*p, fp) == EOF)
|
||||
return EOF;
|
||||
p++;
|
||||
len--;
|
||||
uio->uio_resid--;
|
||||
}
|
||||
}
|
||||
{
|
||||
GETIOV (;);
|
||||
while (len > 0)
|
||||
{
|
||||
if (putc(*p, fp) == EOF)
|
||||
return EOF;
|
||||
p++;
|
||||
len--;
|
||||
uio->uio_resid--;
|
||||
}
|
||||
}
|
||||
while (uio->uio_resid > 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This is file MKTEMP.C */
|
||||
/* This file may have been modified by DJ Delorie (Jan 1991). If so,
|
||||
** these modifications are Copyright (C) 1991 DJ Delorie
|
||||
** these modifications are Copyright (C) 1991 DJ Delorie.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user