delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/02/02:30:02

Date: Wed, 2 Oct 1996 10:06:33 +0400 (MSD)
From: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Message-Id: <199610020606.KAA05370@video.yars.free.net>
To: djgpp AT delorie DOT com, stenns AT www DOT tci DOT uni-hannover DOT de
Subject: Re: ftell bug with text files ?

> It seems that the failure occurs when a line break is on a
> mutilple of 16384 bytes (the value of BUFSIZ in stdio.h).
> Line breaks in MSDOS are <cr><lf> pairs, but in the internal buffer
> a line break is only <lf>. Ftell scans the unread part of the buffer
> to account for stripped <cr>'s, but if the buffer ends with a <cr>
> this is currently not seen by ftell.

Take a look at the alpha snapshots' libc. The problem you describe and many
others are fixed there.

To fix ftell/fseek, it was needed to make stdio buffers hold non-processed
raw data, thus avoiding all collisions with hidden cr's.

- Raw text -


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