From 042696f7e8c9569afbe130760d85074a69a84087 Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Sat, 5 Nov 2016 13:00:08 +0000 Subject: [PATCH] Open text files with "wb" causes issues on Windows Text files need to be opened for writing with "w", so that stdio does the right thing in respect to the correct line endings for the current OS. ("\r\n" in Windows, "\n" in Linux). --- re2c/src/codegen/output.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index 5276ef77..8d4f3945 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -71,7 +71,7 @@ bool OutputFile::open () } else { - file = fopen (file_name, "wb"); + file = fopen (file_name, "w"); } return file != NULL; } @@ -346,7 +346,7 @@ HeaderFile::HeaderFile (const char * fn) bool HeaderFile::open () { - file = fopen (file_name, "wb"); + file = fopen (file_name, "w"); return file != NULL; } -- 2.50.1