From 35fb26370c88b9d61c6a1f95e0da5872ef882baf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 1 Jun 2009 08:04:16 +0200 Subject: Work around a regression in Windows 7, causing erase_in_line() to crash sometimes The function FillConsoleOutputCharacterA() was pretty content in XP to take a NULL pointer if we did not want to store the number of written columns. In Windows 7, it crashes, but only when called from within Git Bash, not from within cmd.exe. Go figure. Signed-off-by: Johannes Schindelin Signed-off-by: Steffen Prohaska Signed-off-by: Junio C Hamano --- win32/winansi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win32/winansi.c b/win32/winansi.c index d95bd473b..52d401220 100644 --- a/win32/winansi.c +++ b/win32/winansi.c @@ -81,6 +81,7 @@ static void set_console_attr(void) static void erase_in_line(void) { CONSOLE_SCREEN_BUFFER_INFO sbi; + DWORD dummy; /* Needed for Windows 7 (or Vista) regression */ if (!console) return; @@ -88,7 +89,7 @@ static void erase_in_line(void) GetConsoleScreenBufferInfo(console, &sbi); FillConsoleOutputCharacterA(console, ' ', sbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition, - NULL); + &dummy); } static void erase_till_end_of_screen(void) -- cgit v1.2.3-55-g6feb