Fix windows writing bug (see 1124 on trunk).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1138 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hiker 2007-05-30 07:26:50 +00:00
parent 9f5dfbee7e
commit e373dbbe07

View File

@ -35,7 +35,15 @@ namespace lisp
: m_indent_depth(0) : m_indent_depth(0)
{ {
m_owner = true; m_owner = true;
#ifdef WIN32
// With mingw, the files are written dos style (crlf), but
// these files can't be read with the lexer here. So we have
// to force the file to be written as binary for windows.
printf("Setting binary");
m_out = new std::ofstream(filename.c_str(),::std::ios_base::binary);
#else
m_out = new std::ofstream(filename.c_str()); m_out = new std::ofstream(filename.c_str());
#endif
if(!m_out->good()) if(!m_out->good())
{ {
char msg[MAX_ERROR_MESSAGE_LENGTH]; char msg[MAX_ERROR_MESSAGE_LENGTH];