From 51add68064e8fe8f7a93cbfadeabb62d605b74aa Mon Sep 17 00:00:00 2001 From: Michael Geddes Date: Thu, 3 Jun 2010 14:35:41 +0200 Subject: [PATCH] cmd: Prevent chcp in git.cmd from gobbling stdin (fixes issue 474) If stdin is redirected via < in the call to git.cmd, the content was being taken by the call to chcp. This is fixed by feeding nul into chcp. Signed-off-by: Michael Geddes Signed-off-by: Sebastian Schuberth --- cmd/git.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/git.cmd b/cmd/git.cmd index 773a2d9b..27b91f09 100644 --- a/cmd/git.cmd +++ b/cmd/git.cmd @@ -17,11 +17,11 @@ @rem Get the current GUI ("ANSI") codepage. @for /f %%i in ('getcp -ansi') do @set cp_ansi=%%i @rem Set the console codepage to match the GUI codepage. -@chcp %cp_ansi% > nul +@chcp %cp_ansi% > nul < nul @git.exe %* @set ErrorLevel=%ErrorLevel% @rem Restore the original console codepage. -@chcp %cp_oem% > nul +@chcp %cp_oem% > nul < nul @goto quit :gui -- 2.11.4.GIT