From 433896b1fcaaf85dcb7cd99bf76c7a13398d3f03 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 23 Dec 2016 18:01:51 +0100 Subject: [PATCH] Make explicitly sure that files are opened in binary mode Signed-off-by: Sven Strickroth --- src/Git/Git.cpp | 2 +- src/TortoiseProc/Commands/CatCommand.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 62e0248f1..0104e074b 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -3193,7 +3193,7 @@ bool CGit::LoadTextFile(const CString &filename, CString &msg) if (!PathFileExists(filename)) return false; - CAutoFILE pFile = _wfsopen(filename, L"r", SH_DENYWR); + CAutoFILE pFile = _wfsopen(filename, L"rb", SH_DENYWR); if (!pFile) { ::MessageBox(nullptr, L"Could not open " + filename, L"TortoiseGit", MB_ICONERROR); diff --git a/src/TortoiseProc/Commands/CatCommand.cpp b/src/TortoiseProc/Commands/CatCommand.cpp index 8b4d161ca..5a81292a4 100644 --- a/src/TortoiseProc/Commands/CatCommand.cpp +++ b/src/TortoiseProc/Commands/CatCommand.cpp @@ -50,7 +50,7 @@ bool CatCommand::Execute() if (git_object_type(obj) == GIT_OBJ_BLOB) { - CAutoFILE file = _wfsopen(savepath, L"w", SH_DENYRW); + CAutoFILE file = _wfsopen(savepath, L"wb", SH_DENYRW); if (file == nullptr) { ::DeleteFile(savepath); -- 2.11.4.GIT