changeset 11241:70919685e7dd

More support for FreeMiNT.
author Bruno Haible <bruno@clisp.org>
date Sun, 01 Mar 2009 11:01:31 +0100
parents 641a6d533259
children 4a120b892043
files ChangeLog lib/fpurge.c
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-01  Bruno Haible  <bruno@clisp.org>
+
+	More support for FreeMiNT.
+	* lib/fpurge.c (fpurge): Correct last commit.
+	Reported by Alan Hourihane <alanh@fairlite.co.uk>.
+
 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	Fix unportable awk script in vc-list-files.
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -120,9 +120,14 @@
       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."