From 93c995ce87e0733e0afc421b4d7d983c6669bd79 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 17 May 2013 15:39:15 -0700 Subject: Set stdout to binary mode in -t msvc. Fixes issue #575. --- src/msvc_helper_main-win32.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc index 647bb86..8a0479c 100644 --- a/src/msvc_helper_main-win32.cc +++ b/src/msvc_helper_main-win32.cc @@ -14,6 +14,8 @@ #include "msvc_helper.h" +#include +#include #include #include @@ -123,6 +125,10 @@ int MSVCHelperMain(int argc, char** argv) { output = parser.Parse(output); WriteDepFileOrDie(output_filename, parser); } + + // CLWrapper's output already as \r\n line endings, make sure the C runtime + // doesn't expand this to \r\r\n. + _setmode(_fileno(stdout), _O_BINARY); printf("%s", output.c_str()); return exit_code; -- cgit v0.12