From: Bruno Haible Date: Sun, 1 Mar 2009 10:01:31 +0000 (+0100) Subject: More support for FreeMiNT. X-Git-Tag: v0.1~6245 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=e0ffcc54b25141ac005b9db616429cb37d0cb8d5;p=gnulib.git More support for FreeMiNT. --- diff --git a/ChangeLog b/ChangeLog index 9e629c8c7..2f0ba7422 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-01 Bruno Haible + + More support for FreeMiNT. + * lib/fpurge.c (fpurge): Correct last commit. + Reported by Alan Hourihane . + 2009-03-01 Ralf Wildenhues Fix unportable awk script in vc-list-files. diff --git a/lib/fpurge.c b/lib/fpurge.c index 0e2931eb1..5e0d47dda 100644 --- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -120,9 +120,14 @@ fpurge (FILE *fp) fp->__bufp = fp->__pushback_bufp; fp->__pushed_back = 0; } + /* Preserve the current file position. */ + if (fp->__target != -1) + fp->__target += fp->__bufp - fp->__buffer; fp->__bufp = fp->__buffer; + /* Nothing in the buffer, next getc is nontrivial. */ fp->__get_limit = fp->__bufp; - fp->__put_limit = fp->__bufp; + /* Nothing in the buffer, next putc is nontrivial. */ + fp->__put_limit = fp->__buffer; 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."