home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
gnu
/
flexs237.lzh
/
FLEXS237
/
YYREAD.C
< prev
Wrap
C/C++ Source or Header
|
1993-07-29
|
726b
|
34 lines
#ifdef atarist
#include <unistd.h>
/*
* read, ignoring CR's
*
* ++jrb
* revised by mjf
*/
int _yyread(int fd, char *buf, int size)
{
register char c;
register char *in;
register char *intop;
register char *out = buf;
int count;
do {
in = out;
count = read(fd, in, size); /* get some more characters */
if (count <= 0) return count; /* did we get anything? */
intop = in + count; /* remove '\r' characters */
while (in != intop) {
c = *in++;
if(c != '\r') *out++ = c;
}
} while(out == buf); /* try again if nothing remains */
return (out - buf);
}
#endif /* atarist */