gEDA-bug: [ geda-Patches-1733826 ] Avoid writting '\r' to files on MinGW
SourceForge.net
noreply at sourceforge.net
Fri Jun 8 18:08:46 EDT 2007
Patches item #1733826, was opened at 2007-06-08 19:08
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=818428&aid=1733826&group_id=161080
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32 port
Group: CVS
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Cesar Strauss (cstrauss)
Assigned to: Nobody/Anonymous (nobody)
Summary: Avoid writting '\r' to files on MinGW
Initial Comment:
When using the "w" mode in fopen, MinGW translates LF into CR-LF. This creates havoc when reading the same file again, when sharing schematics files with other systems, and when placing them in a VCS.
This can be avoided by using the "wb" mode. The "b" is ignored on all POSIX conforming systems, according to these sources:
http://www.die.net/doc/linux/man/man3/fopen.3.html
http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html
There are other ways, however. Adding
#include <fcntl.h>
int _fmode = _O_BINARY;
on some source file should work as well. Another way is linking against the MinGW supplied binmode.o, which does exactly that.
Cesar
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=818428&aid=1733826&group_id=161080
More information about the geda-bug
mailing list