mirror of
https://github.com/git/git.git
synced 2024-11-20 03:24:06 +01:00
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>
This commit is contained in:
parent
900a5d075e
commit
492f70913e
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user