Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin

2016-12-23 Thread Beat Bolli
Hi Dscho On 2016-12-23 10:30, Johannes Schindelin wrote: Hi Beat, On Fri, 23 Dec 2016, Beat Bolli wrote: On 22.12.16 18:08, Johannes Schindelin wrote: > diff --git a/compat/winansi.c b/compat/winansi.c > index cb725fb02f..590d61cb1b 100644 > --- a/compat/winansi.c > +++ b/compat/winansi.c >

Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin

2016-12-23 Thread Johannes Schindelin
Hi Beat, On Fri, 23 Dec 2016, Beat Bolli wrote: > On 22.12.16 18:08, Johannes Schindelin wrote: > > diff --git a/compat/winansi.c b/compat/winansi.c > > index cb725fb02f..590d61cb1b 100644 > > --- a/compat/winansi.c > > +++ b/compat/winansi.c > > @@ -84,6 +84,7 @@ static void

Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin

2016-12-22 Thread Junio C Hamano
Beat Bolli writes: >> @@ -84,6 +84,7 @@ static void warn_if_raster_font(void) >> static int is_console(int fd) >> { >> CONSOLE_SCREEN_BUFFER_INFO sbi; >> +DWORD mode; > > Nit: can we move this definition into the block below where it's used? > >> HANDLE hcon;

Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin

2016-12-22 Thread Beat Bolli
On 22.12.16 18:08, Johannes Schindelin wrote: > When determining whether a handle corresponds to a *real* Win32 Console > (as opposed to, say, a character device such as /dev/null), we use the > GetConsoleOutputBufferInfo() function as a tell-tale. > > However, that does not work for *input*

[PATCH v2 1/3] mingw: adjust is_console() to work with stdin

2016-12-22 Thread Johannes Schindelin
When determining whether a handle corresponds to a *real* Win32 Console (as opposed to, say, a character device such as /dev/null), we use the GetConsoleOutputBufferInfo() function as a tell-tale. However, that does not work for *input* handles associated with a console. Let's just use the