aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-06-01 08:04:16 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-02-07 22:40:40 +0700
commit35fb26370c88b9d61c6a1f95e0da5872ef882baf (patch)
tree8ece2287fd44a61c25ad95cafda597263554a0a6
parentdeae0c7bf351969e55f09a540a04dca1c4752b36 (diff)
downloadbusybox-w32-35fb26370c88b9d61c6a1f95e0da5872ef882baf.tar.gz
busybox-w32-35fb26370c88b9d61c6a1f95e0da5872ef882baf.tar.bz2
busybox-w32-35fb26370c88b9d61c6a1f95e0da5872ef882baf.zip
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>
-rw-r--r--win32/winansi.c3
1 files changed, 2 insertions, 1 deletions
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)
81static void erase_in_line(void) 81static void erase_in_line(void)
82{ 82{
83 CONSOLE_SCREEN_BUFFER_INFO sbi; 83 CONSOLE_SCREEN_BUFFER_INFO sbi;
84 DWORD dummy; /* Needed for Windows 7 (or Vista) regression */
84 85
85 if (!console) 86 if (!console)
86 return; 87 return;
@@ -88,7 +89,7 @@ static void erase_in_line(void)
88 GetConsoleScreenBufferInfo(console, &sbi); 89 GetConsoleScreenBufferInfo(console, &sbi);
89 FillConsoleOutputCharacterA(console, ' ', 90 FillConsoleOutputCharacterA(console, ' ',
90 sbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition, 91 sbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition,
91 NULL); 92 &dummy);
92} 93}
93 94
94static void erase_till_end_of_screen(void) 95static void erase_till_end_of_screen(void)