diff --git a/lib/fflush.c b/lib/fflush.c index 3b17655..9f75ccd 100644 --- a/lib/fflush.c +++ b/lib/fflush.c @@ -63,12 +63,6 @@ clear_ungetc_buffer (FILE *fp) } # elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ /* Nothing to do. */ -# elif defined __MINT__ /* Atari FreeMiNT */ - if (fp->__pushed_back) - { - fp->__bufp = fp->__pushback_bufp; - fp->__pushed_back = 0; - } # else /* other implementations */ fseek (fp, 0, SEEK_CUR); # endif diff --git a/lib/fpurge.c b/lib/fpurge.c index 0e2931e..d54e80f 100644 --- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -115,14 +115,10 @@ fpurge (FILE *fp) fp->_Rend = fp->_Next; return 0; # elif defined __MINT__ /* Atari FreeMiNT */ - if (fp->__pushed_back) - { - fp->__bufp = fp->__pushback_bufp; - fp->__pushed_back = 0; - } - fp->__bufp = fp->__buffer; - fp->__get_limit = fp->__bufp; - fp->__put_limit = fp->__bufp; + fp->__pushback_bufp = 0; + if (fp->__mode.__write) + fp->__put_limit = fp->__buffer; + fp->__bufp = fp->__get_limit; return 0; # else #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib." diff --git a/lib/freading.c b/lib/freading.c index f20affc..2399dc7 100644 --- a/lib/freading.c +++ b/lib/freading.c @@ -47,10 +47,9 @@ freading (FILE *fp) return ((fp->_Mode & 0x2 /* _MOPENW */) == 0 || (fp->_Mode & 0x1000 /* _MREAD */) != 0); #elif defined __MINT__ /* Atari FreeMiNT */ - return (!fp->__mode.__write - || (fp->__mode.__read - && (fp->__buffer < fp->__get_limit - /*|| fp->__bufp == fp->__put_limit ??*/))); + if (!fp->__mode.__write && fp->__mode.__read) + return 1; + return (fp->__flags & _IO_CURRENTLY_GETTING) != 0; #else #error "Please port gnulib freading.c to your platform!" #endif diff --git a/lib/fseeko.c b/lib/fseeko.c index 78e2b2f..6fd9365 100644 --- a/lib/fseeko.c +++ b/lib/fseeko.c @@ -83,10 +83,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) && fp->_Rback == fp->_Back + sizeof (fp->_Back) && fp->_Rsave == NULL) #elif defined __MINT__ /* Atari FreeMiNT */ - if (fp->__bufp == fp->__buffer - && fp->__get_limit == fp->__bufp - && fp->__put_limit == fp->__bufp - && !fp->__pushed_back) + if (0) #else #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." #endif diff --git a/lib/fwriting.c b/lib/fwriting.c index b7fa455..ba05e65 100644 --- a/lib/fwriting.c +++ b/lib/fwriting.c @@ -41,10 +41,9 @@ fwriting (FILE *fp) return ((fp->_Mode & 0x1 /* _MOPENR */) == 0 || (fp->_Mode & 0x2000 /* _MWRITE */) != 0); #elif defined __MINT__ /* Atari FreeMiNT */ - return (!fp->__mode.__read - || (fp->__mode.__write - && (fp->__buffer < fp->__put_limit - /*|| fp->__bufp == fp->__get_limit ??*/))); + if (!fp->__mode.__read && fp->__mode.__write) + return 1; + return (fp->__flags & _IO_CURRENTLY_PUTTING) != 0; #else #error "Please port gnulib fwriting.c to your platform!" #endif