fix W343-1 open win32 bug from known bugs page

W343-1 Redirecting score output through a pipe doesn't work.
This commit is contained in:
nethack.allison
2006-04-25 01:16:54 +00:00
parent f0963e3fb6
commit 3e2f7f946d
4 changed files with 29 additions and 9 deletions

View File

@@ -56,6 +56,7 @@ INPUT_RECORD ir;
* from the command line.
*/
int GUILaunched;
extern int redirect_stdout;
static BOOL FDECL(CtrlHandler, (DWORD));
#ifdef PORT_DEBUG
@@ -941,8 +942,12 @@ msmsg VA_DECL(const char *, fmt)
VA_INIT(fmt, const char *);
Vsprintf(buf, fmt, VA_ARGS);
VA_END();
xputs(buf);
if (ttyDisplay) curs(BASE_WINDOW, cursor.X+1, cursor.Y);
if (redirect_stdout)
fprintf(stdout,"%s",buf);
else {
xputs(buf);
if (ttyDisplay) curs(BASE_WINDOW, cursor.X+1, cursor.Y);
}
return;
}