Re: [PATCH 07/11] Add O_BINARY flag to open flag at mingw.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 18 Aug 2009, Frank Li wrote:

> > How about this instead?
> >
> >        mingw.c: Use the O_BINARY flag to open files
> >
> >        On Windows, non-text files must be opened using the O_BINARY flag.
> >        MinGW does this for us automatically, but Microsoft Visual C++
> >        does not.
> >
> >        Also, Johannes said that this would be a nice cleanup.
> >
> 
> Okay, Do you need me change commit comments to resubmit patch?

How about updating your branch at tgit.git with the new commit 
messages first?  (Use rebase -i...)

> > BTW what about fopen()?
> 
> I never found problem at fopen, I will double check it.

Well, it is better to be sure, not by testing it, but rather by inspecting 
the code paths.  Is there any way Git wants to open a binary file with 
fopen()?  If so, it cannot use the modes "r" and "w" there, but must use 
"rb" and "wb".

It gets doubly complicated if there are code paths that _want_ to open 
text files (such as .git/config), which are user-writable, so they could 
(in theory) contain CR/LF line endings.

Ciao,
Dscho

>
> >
> > Patch is obviously good.
> >
> > Ciao,
> > Dscho
> >
>

P.S.: please remove such quoted text, it is totally uninteresting in this 
context (you do not reply to it, either). 

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]