do not expect user input if stdin is redirected

If GZDoom is built on a POSIX system without the GTK frontend and not
run from a KDE session, an IWAD picker is presented on the terminal
and expects the user to select a game wad. However, if stdin is
redirected, this won't work, so start with the default IWAD instead.
This commit is contained in:
Fabian Greffrath 2019-12-10 22:00:04 +01:00 committed by alexey.lysiuk
parent 194dd3e4cf
commit cc7807bb10

View file

@ -260,6 +260,11 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
return I_PickIWad_Cocoa (wads, numwads, showwin, defaultiwad);
#endif
if (!isatty(fileno(stdin)))
{
return defaultiwad;
}
printf ("Please select a game wad (or 0 to exit):\n");
for (i = 0; i < numwads; ++i)
{