#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 */
