www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/06/23/09:59:13

Message-Id: <m0yoTak-000aSKC@sloep03.cs.vu.nl>
Date: Tue, 23 Jun 98 15:58:34 MET DST
From: Michel de Ruiter <mdruiter AT cs DOT vu DOT nl>
To: dj AT delorie DOT com
cc: djgpp-workers AT delorie DOT com
Subject: rewind-bug fixed

Hello, workers,

The problem with rewind and files opened "r+" turned out to be
very simple. Applying the following patch seems to fix things:

--- src/libc/ansi/stdio/rewind.old	Mon Dec 26 15:34:52 1994
+++ src/libc/ansi/stdio/rewind.c	Sat Jun 20 14:40:16 1998
@@ -8,6 +8,7 @@ void rewind(FILE *f)
 {
   fflush(f);
   lseek(fileno(f), 0L, SEEK_SET);
+  f->_fillsize = 512;	/* See comment in filbuf.c */
   f->_cnt = 0;
   f->_ptr = f->_base;
   f->_flag &= ~(_IOERR|_IOEOF);

Hope this helps.

--
Groeten, Michel.        http://www.cs.vu.nl/~mdruiter
  ____________
  \  /====\  /          "You know, Beavis, you need things that suck,
   \/      \/           to have things that are cool", Butt-Head.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019