-LRN: isatty equivalent for w32
authorChristian Grothoff <christian@grothoff.org>
Sun, 17 Jun 2012 14:47:11 +0000 (14:47 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 17 Jun 2012 14:47:11 +0000 (14:47 +0000)
src/fs/gnunet-download.c

index aa1da8f3dad35a37104ba322d485eec6b2ff91a0..e3fb10947b0a49a55d132321edf300fe780619a4 100644 (file)
@@ -91,9 +91,12 @@ display_bar (unsigned long long x,
   unsigned int endeq;
   float ratio_complete;
 
-#ifndef MINGW
+#if !WINDOWS
   if (0 == isatty (1))
     return;
+#else
+  if (FILE_TYPE_CHAR != GetFileType (GetStdHandle (STD_OUTPUT_HANDLE)))
+    return;
 #endif
   ratio_complete = x/(float)n;
   endeq = ratio_complete * w;