From df90b00e122c4d2312c80e30209e3c8946621633 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 25 Nov 2001 00:48:44 +0000 Subject: [PATCH] Fixed IO when not run with wineconsole. --- debugger/debug.l | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debugger/debug.l b/debugger/debug.l index 6064c32464c..c882eada5af 100644 --- a/debugger/debug.l +++ b/debugger/debug.l @@ -205,9 +205,12 @@ int DEBUG_ReadLine(const char* pfx, char * buf, int size, int remind) for (;;) { DEBUG_FlushSymbols(); - WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pfx, strlen(pfx), NULL, NULL); + /* as of today, console handles can be file handles... so better use file APIs rather than + * consoles + */ + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), pfx, strlen(pfx), &nread, NULL); - if (!ReadConsole(GetStdHandle(STD_INPUT_HANDLE), buf_line, sizeof(buf_line), &nread, NULL)) + if (!ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf_line, sizeof(buf_line), &nread, NULL)) break; /* FIXME: should be rewritten not to remove and then add the trailing '\n' */ if (nread > 0 && buf_line[nread - 1] == '\n') nread--; -- 2.11.4.GIT