}
#endif /* O_NDELAY */
+#if defined (__MINGW32__)
+ /* We use getch to read console input, so use the same
+ mechanism to check for more. Otherwise, we don't know. */
+ if (isatty (fileno (rl_instream)))
+ chars_avail = _kbhit ();
+ else
+ chars_avail = 0;
+ result = 0;
+#endif
+
/* If there's nothing available, don't waste time trying to read
something. */
if (chars_avail <= 0)
return (chars_avail);
#endif
+#endif
+
+#if defined (__MINGW32__)
+ /* We use getch to read console input, so use the same
+ mechanism to check for more. Otherwise, we don't know. */
+ if (isatty (fileno (rl_instream)))
+ return _kbhit ();
#endif
return 0;