* lib/isatty.c (IsConsoleHandle): Change from testing the lower
2 bits of the handle to the more expensive but accurate syscall.
+2014-06-09 Michael Goffioul <michael.goffioul@gmail.com>
+
+ isatty: fix to work on windows 8
+ * lib/isatty.c (IsConsoleHandle): Change from testing the lower
+ 2 bits of the handle to the more expensive but accurate syscall.
+
2014-06-07 Paul Eggert <eggert@cs.ucla.edu>
maint: fix typo in fdl.texi
/* Get _get_osfhandle(). */
#include "msvc-nothrow.h"
-/* Optimized test whether a HANDLE refers to a console.
- See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>. */
-#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
+static BOOL IsConsoleHandle (HANDLE h)
+{
+ DWORD mode;
+ return GetConsoleMode (h, &mode) != 0;
+}
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int