Re: [PATCH 5/5] Win32: Thread-safe windows console output

2014-06-06 Thread Karsten Blees
Am 06.06.2014 23:29, schrieb Peter Krefting: > Stepan Kasal: > >> +/* only called from console_thread, so a static buffer will do */ >> +static wchar_t wbuf[2 * BUFFER_SIZE + 1]; > > Wouldn't BUFFER_SIZE + 1 (or even BUFFER_SIZE) do here? If you convert from > up to BUFFER_SIZE octets of

Re: [PATCH 5/5] Win32: Thread-safe windows console output

2014-06-06 Thread Peter Krefting
Stepan Kasal: + /* only called from console_thread, so a static buffer will do */ + static wchar_t wbuf[2 * BUFFER_SIZE + 1]; Wouldn't BUFFER_SIZE + 1 (or even BUFFER_SIZE) do here? If you convert from up to BUFFER_SIZE octets of UTF-8 input, you should never get back more than B

[PATCH 5/5] Win32: Thread-safe windows console output

2014-06-06 Thread Stepan Kasal
From: Karsten Blees Winansi.c has many static variables that are accessed and modified from the [v][f]printf / fputs functions overridden in the file. This may cause multi threaded git commands that print to the console to produce corrupted output or even crash. Additionally, winansi.c doesn't o