[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    [PATCH 03/11] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes
From:       Steffen Prohaska <prohaska () zib ! de>
Date:       2009-05-31 16:15:17
Message-ID: 1243786525-4493-4-git-send-email-prohaska () zib ! de
[Download RAW message or body]

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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 <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 compat/winansi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compat/winansi.c b/compat/winansi.c
index 44dc293..4bee335 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -80,6 +80,7 @@ static void set_console_attr(void)
 static void erase_in_line(void)
 {
 	CONSOLE_SCREEN_BUFFER_INFO sbi;
+	long dummy; /* Needed for Windows 7 (or Vista) regression */
 
 	if (!console)
 		return;
@@ -87,7 +88,7 @@ static void erase_in_line(void)
 	GetConsoleScreenBufferInfo(console, &sbi);
 	FillConsoleOutputCharacterA(console, ' ',
 		sbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition,
-		NULL);
+		&dummy);
 }
 
 
-- 
1.6.3.1.54.g99dd

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic