diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-06-01 08:04:16 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-01 00:08:54 -0700 |
commit | 492f70913e11de19bc4cb197b1fe195c645b89c9 (patch) | |
tree | 2f564c3827c5d3b169e83bb3a7582106cf626da5 /compat | |
parent | Quiet make: do not leave Windows behind (diff) | |
download | tgif-492f70913e11de19bc4cb197b1fe195c645b89c9.tar.xz |
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 <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r-- | compat/winansi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/winansi.c b/compat/winansi.c index 44dc293ad3..9217c24b43 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; + DWORD 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); } |