Re: new module 'isatty' (was: Re: MS-Windows build of Grep [2/4])

2012-01-03 Thread Bastien ROUCARIES
On Tue, Jan 3, 2012 at 9:36 AM, Eli Zaretskii wrote: >> From: Bruno Haible >> Cc: bastien ROUCARIES , Eli Zaretskii >> , Eric Blake , bonz...@gnu.org, >> bug-g...@gnu.org >> Date: Tue, 03 Jan 2012 03:56:56 +0100 >> >> I'm adding this new module. Feel free to use it in 'grep'. > > Thanks > >> #d

Re: new module 'isatty' (was: Re: MS-Windows build of Grep [2/4])

2012-01-03 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bastien ROUCARIES , Eli Zaretskii > , Eric Blake , bonz...@gnu.org, > bug-g...@gnu.org > Date: Tue, 03 Jan 2012 03:56:56 +0100 > > I'm adding this new module. Feel free to use it in 'grep'. Thanks > #define IsConsoleHandle(h) (((long) (h) & 3) == 3) Where does this

new module 'isatty' (was: Re: MS-Windows build of Grep [2/4])

2012-01-02 Thread Bruno Haible
bastien ROUCARIES wrote: > The right fix is : > DWORD st; > /* note use _ version for porting to vc */ > if(!_isattty(fd)) > return 0; > if (!GetConsoleMode(_get_osfhandle(fd), &st)) > return 0; > return 1; > > This is the idea Thanks for the idea. > it is a little bit more complic