Date: Wed, 1 Dec 1999 09:55:48 +0200 (IST)
From: Eli Zaretskii <[EMAIL PROTECTED]>
On Tue, 30 Nov 1999, John Trudeau wrote:
> ! result = xmalloc (file_size + 2);
>
> /* VMS stat lies about the st_size value. The actual number of
> readable bytes is always less than this value. The arcane
> --- 158,164 ----
> goto error_exit;
>
> /* Load the file, with enough room for a newline and a null. */
> ! result = xmalloc (file_size*2 + 2);
Could you please explain the need for this strange patch in more
detail? You are, in effect, saying that the file size returned by the
library function `stat', as implemented in the Cygwin library, lies
about the true file size by a factor of two! I find this hard to
believe.
Is it possible that you are somehow using Cygwin in a mode where the
default character type is a wide 16-bit character (i.e., Unicode)?
No, the right thing is to use O_BINARY in the call to read();.
Brian
--
== The Difference Between Cultures: ==
Einigkeit und Recht und Freiheit
Liberte', E'galite', Fraternite'
Sex, drugs and rock'n'roll