Mail Archives: djgpp/1996/06/03/07:22:10
On Mon, 3 Jun 1996, Jorrit Tyberghein wrote:
> Recently I upgraded from DJGPP 2.0beta3 to the non-beta version
> of DJGPP. When I recompiled my program with the new DJGPP it
> worked perfectly except for one thing. Some parts of the program
> appeared to be unbearably slow.
>
> I traced the problem down to the 'fseek' function. There are several
> places in my program where I scan a file while I only need several
The version of `fseek' that was in beta3 had a subtle bug when dealing
with text files. Therefore, it was replaced in the release with a
version that is safer but much slower in some situations, because it just
discards all the buffered characters and rereads them. The reason for
this is that, for text files, there is no way to know where those deleted
CR characters were in the buffer, or even if they were there at all (it
might have been a Unix-style text file). The old buggy version broke
some programs (like `patch') and had to be replaced very close to the
release date, when there was no time to redesign the entire
`fseek'/`ftell' machinery.
> Can I get the old behaviour back?
The next DJGPP release should have faster `fseek'.
- Raw text -