Subject: Re: [PATCH] bundle: fix wrong check of read_header()'s return value & add tests

From: Mark Levedahl <[email-masked]>
Date: Thu, 08 Mar 2007 15:43:23 -0500

Johannes Schindelin wrote:
> IIRC there was a problem when a file was detected to be text, but 
> continued to be binary. Mark?
>
> Ciao,
> Dscho
>
>   
The problem occurs with constructs like

echo "some text stuff"  > file
echo "some binary stuff" >> file

The second write, being an append, ends up executed in a forked process 
where file was opened by the parent, and unfortunately auto-detected as 
a text file, such that the write from the child process ends up mangling 
any crlf in the stream. This occurs regardless of the defined mount type 
and other cygwin flags. It is definitely a bug, but is attributed to 
looseness in POSIX with noone claiming ownership to fix.

However, the above bug is not triggered in the construct mentioned by Junio.

Mark